Nikhil
Nikhil

Reputation: 9

Delete records before sysdate

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

Answers (2)

Olivier Coilland
Olivier Coilland

Reputation: 3096

DELETE FROM ANNOUNCEMENT_TABLE
WHERE ANNOUNCEMENT_DATE < TRUNC(SYSDATE);

Upvotes: 3

PRADEEP R
PRADEEP R

Reputation: 61

Delete from announcement_table where announcement_date <> sysdate; or Delete from announcement_table where announcement_date

Upvotes: -2

Related Questions