
Performs a SQL statement: after every one will delete the data in the morning, say to the no. 7 in the morning is automatically deleted, at no. 8 in the morning is automatically deleted, automatically deleted at 9 in the morning
CodePudding user response:
The timer has started the
Here is my code:
The DROP event IF the EXISTS ninico;
The CREATE EVENT ninico
ON the SCHEDULE
EVERY 1 DAY STARTS DATE_ADD (DATE_ADD (CURDATE (), 1 DAY INTERVAL, the INTERVAL 0 MINUTE)
DO
The delete from sp where time_end=DATE_ADD (curdate (), INTERVAL 0 MINUTE);
Performed delete 2021-03-07 00:00:00 this data, only when I put the system time transferred to the 2021-03-08 00:00:00, delete not to drop the 2021-03-08 00:00:00 to the data