Hi,
Can anyone help me with the script which will delete the data older than the particular date.
Thanks
Hi,
Can anyone help me with the script which will delete the data older than the particular date.
Thanks
delete from YOUR_TABLE where your_date_column < '2009-01-01';
This is pretty vague. Do you mean like in SQL:
DELETE FROM myTable
WHERE dateColumn < '2007'
Delete data that is 30 days and older
DELETE FROM Table
WHERE DateColumn < GETDATE()- 30
or an ORACLE version:
delete
from table_name
where trunc(table_name.date) > to_date('01/01/2009','mm/dd/yyyy')
You could use:
DELETE FROM tableName
where your_date_column < '2009-01-01';
but Keep in mind that the above is really
DELETE FROM tableName
where your_date_column < '2009-01-01 00:00:00';
Not
DELETE FROM tableName
where your_date_column < '2009-01-01 11:59';