RE: TODAY and CURRENT?
От | Francis Solomon |
---|---|
Тема | RE: TODAY and CURRENT? |
Дата | |
Msg-id | NEBBIFFPELJMCJAODNPKIECDCEAA.francis@stellison.co.uk обсуждение исходный текст |
Ответ на | TODAY and CURRENT? (Raymond Chui <raymond.chui@noaa.gov>) |
Список | pgsql-general |
Hi Raymond, You might try something like this: DELETE FROM tablename WHERE datetime < ('now'::timestamp - '10 days'::interval); and DELETE FROM tablename WHERE datetime BETWEEN ('now'::timestamp - '10 hours'::interval) AND 'now'::timestamp; If you just want the date stamp, you can use 'now'::date instead of your TODAY. If you want date-and-time stamp, use 'now'::timestamp - this would match your idea of CURRENT. Hope this helps Francis Solomon > > I have a table with columns > > datetime timestamp, > value float(8) > > I want to delete rows 10 days older or 10 hours older by > > delete from tablename where datetime < TODAY-10; > or > delete from tablename where datetime between CURRENT-10 and CURRENT; > > So are there key words TODAY, CURRENT in PostgreSQL? > > Thank you! >
В списке pgsql-general по дате отправления: