前言 大家好吖,欢迎来到 YY 滴MySQL系列 ,热烈欢迎! 本章主要内容面向接触过C++的老铁 主要内容含:
-- 存储函数
-- 从1到h的累加
create function fun1(n int)
returns int
begin
declare total int default 0;
while n>0 do
set total := total + n;
set n:=n-1;
end while;
return total;
end;