Re: query for records based on date

Поиск
Список
Период
Сортировка
Искать
От
Brandon Metcalf
Тема
Re: query for records based on date
Дата
Msg-id
Pine.LNX.4.58L.0502211447320.24449@cash.rhiamet.com
Ответ на
Список
Дерево обсуждения
query for records based on date "Brandon Metcalf" <bmetcalf@nortel.com>
Re: query for records based on date Martín Marqués <martin@bugs.unl.edu.ar>
Re: query for records based on date "Brandon Metcalf" <bmetcalf@nortel.com>
Re: query for records based on date Richard Huxton <dev@archonet.com>
m == martin@bugs.unl.edu.ar writes:
m> El Lun 21 Feb 2005 17:00, Brandon Metcalf escribi�:m> > If I have a table with an attribute of type "timestamp without timem> > zone", what is the best way to query that table for records that arem> > older than, say, one week.m> >m> > I suppose I could get the current time in epoch seconds and the time ofm> > the attribute in the same, and select those records where the differencem> > is greater than the number of seconds in a week.  Is there somethingm> > easier likem> >m> >   SELECT * FROM table WHERE attribute IS OLDER THAN one week;
m> SELECT * FROM table WHERE attribute < (now()::DATE - 7)::TIMESTAMP;


Thanks.


-- 
Brandon

В списке pgsql-sql по дате отправления
От: Martín Marqués
Дата:
От: Richard Huxton
Дата:
FAQ