当前位置: 首页 > 工具软件 > Casein > 使用案例 >

mysql case多个关键字 使用and 或者in()

丁英韶
2023-12-01

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

 类似资料: