gpt4 book ai didi

mysql 计划事件语法错误

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

您好,我想每隔一小时删除一次 sql 表行。

CREATE EVENT IF NOT EXISTS `money`
ON SCHEDULE
EVERY 1 HOUR

DO
BEGIN

DELETE FROM `money` WHERE `payed` = 'processing' AND `payed2` = 'processing';

END

我收到此错误:

1064 - 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 '' at line 8

最佳答案

这有帮助吗?

DELIMITER $$
CREATE EVENT IF NOT EXISTS `money`
ON SCHEDULE EVERY 1 HOUR
DO
BEGIN

DELETE FROM `money` WHERE `payed` = 'processing' AND `payed2` = 'processing';

END$$

DELIMITER ;

我一直在使用不支持事件的旧服务器版本,但我希望定义它们类似于存储例程。

关于mysql 计划事件语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31442844/

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