问题描述
当一切看起来正常时,为什么会出现语法错误。指出了MysqL工作台上的错误位置。 我检查了很多问题,但没有找到答案。我知道这将是一个小问题,但我无法解决
SELECT * FROM classicmodels.customers;
DELIMITER $$
create function CustomerLevel( credit decimal(10,2))
returns varchar(20) deterministic
begin
declare customerLevel varchar(20);
if (credit > 50000) then set customerLevel = 'PLATINUM';
else if (credit >= 50000 and credit <= 10000) then set customerLevel = 'GOLD';
else IF (credit < 10000) then set customerLevel ='SILVER';
end if;
return (customerLevel);
end; -- this is where the Syntax error code is
$$ DELIMITER ;
/*
Error Code: 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 10
*/
```````````````
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)