Re: Timestamps

Поиск
Список
Период
Сортировка
От 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 по дате отправления:

Предыдущее
От: Neil Conway
Дата:
Сообщение: Re: psql tab completion & USERSET vars
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: RFC: Security documentation