DELIMITER |
CREATE EVENT `e_clear_his_data`
ON SCHEDULE
EVERY 1 DAY STARTS ‘2020-10-16 03:00:00’
DO
BEGIN
DELETE FROM upload_login_log WHERE create_time < DATE_SUB(CURRENT_TIMESTAMP,INTERVAL 30 DAY);
DELETE FROM upload_order_account_log WHERE create_time < DATE_SUB(CURRENT_TIMESTAMP,INTERVAL 30 DAY);
DELETE FROM upload_order_log WHERE create_time < DATE_SUB(CURRENT_TIMESTAMP,INTERVAL 30 DAY);
DELETE FROM upload_pass_register WHERE create_time < DATE_SUB(CURRENT_TIMESTAMP,INTERVAL 30 DAY);
END |
DELIMITER ;

Leave a Reply

电子邮件地址不会被公开。 必填项已用*标注