需要输出查询作为列

时间:2011-04-13 12:19:00

标签: tsql

HI

实际上我需要一个类似的查询:

select x from a as col1 ,
select y from b as col2 ,
select Z from c as col3

,输出应该像

col1 | col2 | col3


 x   |  y   |  z  

1 个答案:

答案 0 :(得分:1)

如果您确定表a,b和c没有多行,则可以执行此操作。

select 
(select x from a) as col1 ,
(select y from b) as col2 ,
(select Z from c) as col3