当name1为“1”时,name2为 “第一”,
当name1为“2”时,name2为 “第二”,
是否可以用case when 实现 ???
SQL case when tableA(name1,name2)
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
7条回答
- DreamTHT 2015-05-27 07:50关注
select name1 ,case name1 when '1' then '第一' when '2' then '第二' else name2 end from tableA
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报