gpt4 book ai didi

MySQL 的事件日程

转载 作者:行者123 更新时间:2023-11-29 11:58:23 27 4
gpt4 key购买 nike

我收到以下错误:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END' at line 7

DELIMITER$$
CREATE EVENT myevs
ON SCHEDULE EVERY 1 DAY

DO
BEGIN
INSERT INTO ww SELECT * FROM fff WHERE dates = NOW()
DELETE FROM fff where dates = NOW()
END$$

DELIMITER;

最佳答案

insertdelete 语句末尾缺少分号 (;):

DELIMITER$$
CREATE EVENT myevs
ON SCHEDULE EVERY 1 DAY

DO
BEGIN
INSERT INTO ww SELECT * FROM fff WHERE dates = NOW();
-- Here --------------------------------------------^

DELETE FROM fff where dates = NOW();
-- And here -----------------------^
END$$

DELIMITER;

关于MySQL 的事件日程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32808424/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com