Re: query by partial timestamp
От | Michael Nolan |
---|---|
Тема | Re: query by partial timestamp |
Дата | |
Msg-id | CAOzAquK1PAXWFu7ViL2R0miDxw=bcP14K4iufA4iufBtS33CXQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: query by partial timestamp (Gavan Schneider <pg-gts@snkmail.com>) |
Ответы |
Re: query by partial timestamp
Re: query by partial timestamp |
Список | pgsql-general |
On 1/8/13, Gavan Schneider <pg-gts@snkmail.com> wrote: > 2. SELECT ... WHERE > '2011-01-01'::TIMESTAMP <= col_of_type_timestamp > AND col_of_type_timestamp <= > '2011-12-31'::TIMESTAMP; This won't quite work, because '2011-12-31'::TIMESTAMP is the same as 2011-12-31 00:00:00.00000 so records timestamped later in the day on the 31st would not get selected SELECT ... WHERE '2011-01-01'::TIMESTAMP <= col_of_type_timestamp AND col_of_type_timestamp < '2012-01:01'::TIMESTAMP; would get all records with a 2011 timestamp. -- Mike Nolan
В списке pgsql-general по дате отправления: