美文网首页我爱编程
mysql if语句的使用

mysql if语句的使用

作者: Eric_Zeng | 来源:发表于2018-04-10 09:48 被阅读36次

/*写在储存过程里或者函数里头*/

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