/*写在储存过程里或者函数里头*/
BEGIN
set @tag_count=4;
select @tag_count:=count(distinct tag)
from temp.original_cash where stdate='20180405';
if @tag_count=6 or @tag_count=9 or @tag_count=5+9 THEN
begin
select 1;
end;
else
select 2;
end if;
END
/*写在储存过程里或者函数里头*/
BEGIN
set @tag_count=4;
select @tag_count:=count(distinct tag)
from temp.original_cash where stdate='20180405';
if @tag_count=6 or @tag_count=9 or @tag_count=5+9 THEN
begin
select 1;
end;
else
select 2;
end if;
END
本文标题:mysql if语句的使用
本文链接:https://www.haomeiwen.com/subject/nfdghftx.html
网友评论