我爱编程

mysql if语句的使用

2018-04-10  本文已影响36人  Eric_Zeng

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

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

上一篇下一篇

猜你喜欢

热点阅读