mysql trigger to delete old data

Solutions on MaxInterview for mysql trigger to delete old data by the best coders in the world

showing results for - "mysql trigger to delete old data"
Adriana
11 Feb 2017
1SET GLdelimiter //
2create event if not exists clean_old_records
3on schedule every 1 week
4do
5begin
6 delete from your_table_name 
7 where 
8 Timestamp < date_sub(curdate(),interval 1 month) ;
9end; //
10delimiter ;OBAL event_scheduler = ON;
11