We have over 5000 orders in our MySQL database from our OSCommerce store. We want to delete any orders over 3 months old and remove any related entries in all relevant tables using an SQL script.
The script should:
- remove all orders and other related entries in all relevant tables (inc. orders, orders_products, orders_status_history and any other relevant tables)
- only target orders older than 3 months
- only target orders where customer_id = 0
- it should not leave any unnecessary info relating to deleted orders behind!
Thanks!