Mysql support multiple statements an event, please?
Truncate table TB;
Insert into TB (aaa, BBB)... ;
CodePudding user response:
Use the begin... End wrapped upCodePudding user response:
Start the transaction;Your DML statements
commit;
CodePudding user response:
1st floor is right to say:
Delimiter |
The CREATE EVENT e_daily
ON the SCHEDULE
EVERY DAY 1
The COMMENT 'Saves the total number of sessions then clears the table each day'
DO
The BEGIN
INSERT INTO site_activity. The totals (time, total)
The SELECT CURRENT_TIMESTAMP, COUNT (*)
The FROM site_activity. Sessions;
The DELETE FROM site_activity. Sessions;
END |
Delimiter.