日期:2014-05-17  浏览次数:20361 次

sql问题Orz
select a,b from table
出来结果是
a   b
XXX xxx
请问怎样让a b两列能只用1个列名表示

   c
XXX xxx 
------解决方案--------------------
select a+b as c from table

------解决方案--------------------
select a+b as c
------解决方案--------------------
select (case when a=某个条件 then a+b else a end),
case when a=某个条件 then null else b end
from tb