Reputation: 9
I want to delete all the records before sysdate. This is my query:
DELETE from ANNOUNCEMENT_TABLE
WHERE ANNOUNCEMENT_DATE != SYSDATE
But it is deleting all the records from database. How can I do this properly?
Upvotes: 0
Views: 1182
Reputation: 3096
DELETE FROM ANNOUNCEMENT_TABLE
WHERE ANNOUNCEMENT_DATE < TRUNC(SYSDATE);
Upvotes: 3
Reputation: 61
Delete from announcement_table where announcement_date <> sysdate; or Delete from announcement_table where announcement_date
Upvotes: -2