我的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
有关此错误原因的任何建议吗?
答案 0 :(得分:1)
您遗失delimiter
,需要关闭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 ;