您的位置:首页 > 数据库 > MySQL

mysql进阶:存储过程中的IF语句(IF THEN ELSEIF THEN ELSE END IF)

2016-06-30 14:35 483 查看
drop procedure if exists p_hello_world;

create procedure p_hello_world(in v_id int)
begin
if (v_id > 0) then
select '> 0';
elseif (v_id = 0) then
select '= 0';
else
select '< 0';
end if;
end;

call p_hello_world(-9);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: