SELECT case when then使用
1、
1 SELECT AlarmStatus,AlarmBit , 2 (CASE AlarmBit 3 WHEN '01' THEN '呼叫中' 4 when '10' then '处理中' 5 WHEN '11' THEN '呼叫中' 6 ELSE '其他测试' --else 可不写 7 END) 注释 8 FROM [dbo].[Sys_AlarmStatus]

2、
1 select * from Sys_AlarmStatus where (case when AlarmBit='01' then '呼叫中' when AlarmBit='10' then '处理中' end) ='呼叫中'


浙公网安备 33010602011771号