储存过程条件

if 条件 than

elseif 条件 

elseif 条件 

elseif 条件 

else

end if;

 

eg:

create procedure showAge(in age int)
begin
if age < 16 then
select "少年";
elseif age<30 then
select "青年";
elseif age<45 then
select "壮年";
else
select "老年";
end if;
end//

 

call showAge(15)//

 

posted @ 2018-07-17 15:45  super久违  阅读(190)  评论(0编辑  收藏  举报