当前位置: 代码迷 >> Sql Server >> 请教SQL中和swith case 相类似的语句是什么
  详细解决方案

请教SQL中和swith case 相类似的语句是什么

热度:73   发布时间:2016-04-27 21:05:14.0
请问SQL中和swith case 相类似的语句是什么?
请问SQL中和swith   case   相类似的语句是什么?

------解决方案--------------------
case when then else end
------解决方案--------------------
case when then else end
------解决方案--------------------
create table a(id int,fname char(8),lname char(8))

select case id when 1 then fname else lname end as name from a;

------解决方案--------------------
case when then else end

------解决方案--------------------
swith case 其实我感觉与 if...else...没什么大的区别,只是形式不同而已,同样是单进单出,不知道有没说错
  相关解决方案