Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何获得以下 TSQL 查询结果的转置 UNION
SELECT TOP 1 Column_A FROM table1 SELECT TOP 1 Column_B FROM table2 SELECT TOP 1 Column_C FROM table3
这样输出将是一行 3 列,每列有一个值:
[Column_A] [Column_B] [Column_C]
像这样:
Select (SELECT TOP 1 Column_A FROM table1) as 'Column_A', (SELECT TOP 1 Column_B FROM table2) as 'Column_B', (SELECT TOP 1 Column_C FROM table3) as 'Column_C'