subtracting minutes from date

Поиск
Список
Период
Сортировка
От Brandon Metcalf
Тема subtracting minutes from date
Дата
Msg-id Pine.LNX.4.58L.0602231350270.30715@cash.rhiamet.com
обсуждение исходный текст
Ответы Re: subtracting minutes from date  (Scott Marlowe <smarlowe@g2switchworks.com>)
Re: subtracting minutes from date  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-general
What is the best way to store a timestamp if all I need to do is
select rows where this timestamp is less than 60 minutes prior to the
current time?

If I have a column called date with data type timestamp without time
zone I know I can use

  SELECT * FROM table WHERE date < (now()::DATE - 7)::TIMESTAMP;

to select rows where date is older than seven days.  I'm not quite
sure how to interpret now()::DATE::TIMESTAMP since I'm not able to
answer my own question.  I've tried things like:

  SELECT * FROM table WHERE date < now()::DATE::(TIMESTAMP - 60);

but this gives a syntax error.

Thanks.

--
Brandon

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

Предыдущее
От: Carlos Henrique Reimer
Дата:
Сообщение: Is the pg_locks been used?
Следующее
От: Kevin Murphy
Дата:
Сообщение: How I changed the encoding of template1 after the fact