Re: Efficient date range search?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Efficient date range search?
Дата
Msg-id 20021007162037.GF2521@dcc.uchile.cl
обсуждение исходный текст
Ответ на Re: Efficient date range search?  (Jean-Luc Lachance <jllachan@nsd.ca>)
Список pgsql-general
On Mon, Oct 07, 2002 at 12:11:35PM -0400, Jean-Luc Lachance wrote:
> Shridhar Daithankar wrote:
> > Create an index on died field. And query like
> >
> > select * from pets where died < "last year july 4 7:01 PM;

> If the pet is still alive today died would be NULL and the where clause
> would not be true.

In that case check for NULL explicitly,

select * from pets where died > [date] or died is null;

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Porque francamente, si para saber manejarse a uno mismo hubiera que
rendir examen... ¿Quién es el machito que tendría carnet?"  (Mafalda)

В списке pgsql-general по дате отправления:

Предыдущее
От: Jean-Luc Lachance
Дата:
Сообщение: Re: Efficient date range search?
Следующее
От: "Nigel J. Andrews"
Дата:
Сообщение: Re: Efficient date range search?