日期:2014-05-19  浏览次数:20518 次

请问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...没什么大的区别,只是形式不同而已,同样是单进单出,不知道有没说错