Reputation: 409
I've the next data table:
customer | category | date_column |
---|---|---|
01 | A | 2021/06/16 |
02 | B | 2021/04/15 |
03 | C | 2021/03/15 |
I would like to create query that would delete rows from this data table older than 2 months and here is my try:
DELETE * FROM schema.table
WHERE DATEADD(Month,2,date_column) < getdate()
By now I've been trying to use DATEADD to make it but seems that this function doesn't work in PostgreSQL. Could you hel me, guys?
This would be the desired output:
customer | category | date_column |
---|---|---|
01 | A | 2021/06/16 |
Thanks by the way.
Upvotes: 1
Views: 9346