sql有关问题Orz
sql问题Orzselect a,b from table出来结果是abXXX xxx请问怎样让a b两列能只用1个列名表示如cXXX xxx [解
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