CREATE EVENT clear_interactive_logs
ON SCHEDULE EVERY 1 DAY
STARTS '2023-09-21 23:36:36'
DO DELETE from t_interactive_log WHERE id not IN (SELECT * from (SELECT id from t_interactive_log ORDER BY occer_time DESC limit 20000) x );
END
创建之后会有
例子二 是网上的例子