sqlserver 查询时的CASE WHEN学习记录
select SUM(1) as '任务数', RPATask_State as id, case RPATask_State when 1 then '已接收' when 3 then '进行中--其他客户端抢占未运行' when 4 then '已完成' when 5 then '异常' else '其他' end from RPATask where RPATask_TaskID LIKE '13789829365%' group by RPATask_State