case when用法。。
case when 转自:http://www.cnblogs.com/zhyue93/p/sql2008.html
|
1
2
3
4
5
6
7
8
9
10
11
12
|
select a.ApplyID,convert(nvarchar(20),a.TripTime,101) as TripTime,a.[Target],a.ApplyerNum,a.ApplyerName,case a.CheckState when 0 then '待审核' when 1 then '审核通过' when 2 then '退回' else '' end as CheckState,case a.AssignState when 0 then '待分派' when 1 then '已分派' else '-' end as AssignState,case a.DriverState when 0 then '退回' when 1 then '已确认' else '-' end as DriverStatefrom cmApply a |
浙公网安备 33010602011771号