How to delete data that is older than one year in Oracle?
To delete data from one year ago, you can follow these steps:
- Specify the time range you want to delete, such as a date from one year ago.
- Use the DELETE statement to remove records that meet certain conditions. For example, to delete order records from one year ago, you can use the following DELETE statement:
DELETE FROM orders
WHERE order_date < SYSDATE - INTERVAL '1' YEAR;
- Make sure to back up your data before executing the DELETE statement to prevent accidental deletion.
Please be aware that deleting data is an irreversible action, so please proceed with caution.