Reputation: 51
Please I have a very large table that store historical data and I want a query that can help me to delete rows/records that are older than 90 days on that table
Upvotes: 1
Views: 5868
Reputation: 2879
enclose the (now() - interval '90 days'))
select (now() - interval '90 days'))
bodmas can apply here. hence without enclosing you may get wrong result, use below
delete from table_name where timestamp_column < (now() - interval '90 days'))
Upvotes: -1
Reputation: 156
delete from table_name
where timestamp_column < now() - interval '90 days'
Upvotes: 2