Article directory
1. The concept of stored functions
Stored functions are very similar to stored procedures, except that the stored function must return a result every time it is called, and the parameters passed in by the stored function can only be of type IN.
Syntax structure for creating a stored function:
CREATE FUNCTION 存储函数名称(参数列表)
RETURNS 返回值的类型 存储函数的特性
BEGIN
SQL逻辑;
RETURN 变量;
END
RETURNS参数指的是声明返回值的数据类型,在MySQL8.