-- 最简单的仅有一条sql的函数
create function myselect2() returns int return 666;
select myselect2(); -- 调用函数
--
create function myselect3() returns int
begin
declare c int;
select id from class where cname="python" into c;
return c;
end;
select myselect3();
-- 带传参的函数
create function myselect5(name varchar(15)) returns int
begin
declare c int;
select id from class where cname=name into c;
return c;
end;
select myselect5("python");