aHMAD_SQaLli 0 Posted December 4, 2015 Hello I want to make a SQL row to be deleted after one day, or week, or every row older than on week automatically, how can it be done ? Have a good day. Quote Share this post Link to post Share on other sites
Barand 1,398 Posted December 4, 2015 Assuming your table has a date column DELETE FROM tablename WHERE date_col < CURDATE() - INTERVAL 7 DAY Quote Share this post Link to post Share on other sites
aHMAD_SQaLli 0 Posted December 4, 2015 Thanks, that was helpful, but I should run this manually, is there any way to be 100% auto . Quote Share this post Link to post Share on other sites
Barand 1,398 Posted December 4, 2015 You would use Windows Scheduler or a cron job (linux) to invoke the query. 1 Quote Share this post Link to post Share on other sites
aHMAD_SQaLli 0 Posted December 4, 2015 Thank you very much ! Quote Share this post Link to post Share on other sites