gpt4 book ai didi

mysql - 创建过程mysql错误在 ''附近

转载 作者:行者123 更新时间:2023-11-29 12:13:47 24 4
gpt4 key购买 nike

我的MySQL语句:

CREATE PROCEDURE latest_procedure() BEGIN
DELETE ac.* FROM s_articles_categories AS ac JOIN s_articles AS a ON ac.articleID = a.id WHERE ac.categoryID = 38;
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 2 

对于此错误的原因有什么建议吗?

最佳答案

您缺少分隔符,需要关闭end

delimiter //

CREATE PROCEDURE latest_procedure() BEGIN
DELETE ac.* FROM s_articles_categories AS ac JOIN s_articles AS a ON ac.articleID = a.id WHERE ac.categoryID = 38;
END;//

delimiter ;

关于mysql - 创建过程mysql错误在 ''附近,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30210146/

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