| От | Mike Rylander |
|---|---|
| Тема | Re: How to filter on timestamps? |
| Дата | |
| Msg-id | ccfrjl$2po8$1@news.hub.org обсуждение |
| Список | pgsql-sql |
<posted & mailed> B.W.H. van Beest wrote: > > > I have a table where one of the columns is of type 'TIMESTAMP' > > How can I do a query to filter on the TIMESTAMP value, e.g. to obtain > all rows earlier than a certain time stamp? Think of the math opperators '<' and '>' as 'before' and 'after', respectively. ie: SELECT * FROM table WHERE begin_date > '2004-07-06'; You can also use BETWEEN: SELECT * FROM table WHERE update_timestamp BETWEEN '2004-07-01' AND '2004-07-06'; Remember that when timestamps are cast to dates, they are cast with 00:00:00.0 as the time part. See the docs on this at http://www.postgresql.org/docs/7.4/interactive/datatype-datetime.html and http://www.postgresql.org/docs/7.4/interactive/functions-datetime.html . --miker > > Regards,
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера