gpt4 book ai didi

mysql - 无法创建存储过程MySQL

转载 作者:行者123 更新时间:2023-11-29 02:24:05 26 4
gpt4 key购买 nike

我正在尝试创建一个存储过程,但我遇到了问题。

    delimiter |
create procedure get_user_credits_2(guid char(50))
BEGIN
SELECT user_credits.GUID,
creditwarninglevel,
creditsexpirydate,
EmailCreditWarningLevel,
EmailAddressWarningLevel,
CustomerName,
CASE WHEN user_credits.Credits > 0
THEN sum(user_credits.Credits) + SUM(user_credits.PurchasedCredits)
ELSE user_credits.Credits
END AS 'Credits'
FROM
user_credits
WHERE guid=iguid;
END
|
delimiter ;


Error 1064: You have an error in your SQL syntax, check the manual to your mysql server version for the right syntax to use near 'END' at line 15.

我检查了一些来源,但我无法让它工作。我确定这可能是我正在寻找的东西。谢谢

我还在此处检查了另一个问题来源:MYSQL stored procedure, case

图片: Screenshot

最佳答案

我解决了这个问题,出于某种原因在 Navitcat IDE 中不喜欢你声明一个过程并开始的事实

BEGIN

END

它只关心select语句。例如

Select * from table;

关于mysql - 无法创建存储过程MySQL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26379475/

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