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!
>

Reply via email to