赞
踩
mysql case多个关键字 使用and 或者in()
case
when count(0) = 1 and count(0) = 2 and count(0) =3) then ‘lv1’
when count(0) = 4 and count(0) = 5 and count(0) =6) then ‘lv2’
else ‘lv3’
end as pertime
case
when count(0) in (1, 2 ,3) then ‘lv1’
when count(0) in (4 , 5 , 6 )then ‘lv2’
when count(0) in (7 , 8 , 9 , 19 , 11 )then ‘lv3’
else ‘lv4’
end as pertime
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。