query for records based on date

Поиск
Список
Период
Сортировка
От Brandon Metcalf
Тема query for records based on date
Дата
Msg-id Pine.LNX.4.58L.0502211356580.24449@cash.rhiamet.com
обсуждение исходный текст
Ответы Re: query for records based on date  (Martín Marqués <martin@bugs.unl.edu.ar>)
Re: query for records based on date  (Richard Huxton <dev@archonet.com>)
Список pgsql-sql
If I have a table with an attribute of type "timestamp without time
zone", what is the best way to query that table for records that are
older than, say, one week.

I suppose I could get the current time in epoch seconds and the time of
the attribute in the same, and select those records where the difference
is greater than the number of seconds in a week.  Is there something
easier like
 SELECT * FROM table WHERE attribute IS OLDER THAN one week;

Thanks.

-- 
Brandon


В списке pgsql-sql по дате отправления:

Предыдущее
От: Achilleus Mantzios
Дата:
Сообщение: Re: Timestamp with timezone question.
Следующее
От: Martín Marqués
Дата:
Сообщение: Re: query for records based on date