📜  mysql 触发器删除旧数据 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:24.759000             🧑  作者: Mango

代码示例1
SET GLdelimiter //
create event if not exists clean_old_records
on schedule every 1 week
do
begin
 delete from your_table_name 
 where 
 Timestamp < date_sub(curdate(),interval 1 month) ;
end; //
delimiter ;OBAL event_scheduler = ON;