储存过程条件

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)//

原文地址:https://www.cnblogs.com/chenliuxiao/p/9323720.html