SQL语句 case ... when

select 字段A, 字段B,

CASE
WHEN t.operate = 1 then 'aa'
WHEN t.operate = 2 then 'bb'
WHEN t.operate = 3 then 'cc'
WHEN t.operate = 4 then 'dd'
WHEN t.operate = 5 then 'ee'
WHEN t.operate = 6 then 'ff'
END
as '字段C'

from t_table

 

天津雍博科技有限责任公司

www.yongbosoft.com

posted @ 2019-05-08 17:46  roundlight  阅读(388)  评论(0编辑  收藏  举报