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