| От | Christopher Kings-Lynne |
|---|---|
| Тема | Re: Timestamps |
| Дата | |
| Msg-id | 40273693.8080408@familyhealth.com.au обсуждение |
| Ответ на | Timestamps (Slavisa Garic <Slavisa.Garic@infotech.monash.edu.au>) |
| Список | pgsql-hackers |
> I wanted to ask a simple question. Say I have a table with the timestamp > field. What is the best way to say get all the records that were created > say 2 hours before the query. One of the options would be to generate the > timestamp in the correct format and then send a query in the format > SELECT * from <table> where create_time < <generated_timestamp> > > Is there a better way than this? Sure is: SELECT * from <table> where create_time < (CURRENT_TIMESTAMP - INTERVAL '2 hours'); Chris
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера