First page Back Continue Last page Image

Example: MySQL One Time Event

DELIMITER //

 

CREATE EVENT one_time_delete_audit_rows

ON SCHEDULE AT NOW() + INTERVAL 1 MONTH

DO BEGIN

DELETE FROM invoices_audit

WHERE action_date < NOW() - INTERVAL 1 MONTH;

END//

Perform this event 1 month from today