相关疑难解决方法(0)

MySQL CREATE FUNCTION语法

我想在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语句.这个功能有什么问题?

mysql function

45
推荐指数
2
解决办法
11万
查看次数

标签 统计

function ×1

mysql ×1