Re: date ranges in where

Поиск
Список
Период
Сортировка
От Raymond O'Donnell
Тема Re: date ranges in where
Дата
Msg-id 4A02D042.9090907@iol.ie
обсуждение исходный текст
Ответ на Re: date ranges in where  (Jasen Betts <jasen@xnet.co.nz>)
Список pgsql-general
On 07/05/2009 12:59, Jasen Betts wrote:
> where lastlogin::date between '2009-05-01'::date and '2009-05-02'::date
>
> If you leave it uncast postgres will probably convert the lastlogin to
> a string and produce results other than that desired and proabaly
> take longer to do it too.

The OP was basing the query on a timestamp column, so I'd say Postgres
was casting everything to timestamp, with the results he reported.

Ray.


------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

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

Предыдущее
От: Jasen Betts
Дата:
Сообщение: Re: date ranges in where
Следующее
От: Raymond O'Donnell
Дата:
Сообщение: Re: Upgrading from postgres 8.1 to 8.3