我收到以下错误:
您的SQL语法有错误;检查手册 对应于您的MySQL服务器版本,以便使用正确的语法 在第7行'END'附近
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;
答案 0 :(得分:1)
您在;
和insert
声明的末尾遗漏了分号(delete
):
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;