我想在MySQL中创建一个函数:
这是SQL代码:
CREATE FUNCTION F_Dist3D (x1 decimal, y1 decimal)
RETURNS decimal
DETERMINISTIC
BEGIN
DECLARE dist decimal;
SET dist = SQRT(x1 - y1);
RETURN dist;
END;
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
#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
Run Code Online (Sandbox Code Playgroud)
我在phpMyAdmin中运行此create语句.这个功能有什么问题?