首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

求一SQL语句关于改变列名,该如何解决

2012-02-01 
求一SQL语句关于改变列名selectcasewhensextruethen男else女endfromtable如何使其列名成为性别,即as写在

求一SQL语句关于改变列名
select  

case   when   sex   =   true   then   '男 '  
else   '女 '
end

from   table

如何使其列名成为性别,即as写在哪

[解决办法]
select

case when sex = true then '男 '
else '女 '
end as xxx

from table
[解决办法]
select

case when sex = true then '男 '
else '女 '
end as 性别

from table

上个帖已经回复了啊

热点排行