| От | Tom Lane |
|---|---|
| Тема | Re: To many records returned |
| Дата | |
| Msg-id | 29758.1207271708@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | To many records returned (Justin <justin@emproshunts.com>) |
| Список | pgsql-general |
Justin <justin@emproshunts.com> writes:
> Have a select statement with a where clause using datestamp with
> timezone column compared to a date
> Select * from sometable where DateStampColumn > '2008-03-31'
> this returns records that are equal 2008-03-31
There's no such thing as "timestamp compared to date". The date
promotes to a timestamp at midnight; what you wrote is equivalent
to
Select * from sometable where DateStampColumn > '2008-03-31 00:00:00'
> but when the query includes casting to date
> Select * from sometable where DateStampColumn::date > '2008-03-31'
> The result is correct
You threw away the intraday part of the timestamp...
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера