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.
我有一张一列五行的表。它给出select *了这些结果:
select *
72594206916 2 1/2/08 Seattle WA
如何从这个表中简单地选择到另一个表中的单行中,这些值有 5 列?
试试这个[假设你在表中只有 5 行]
Select * from ( select col1, row_number() over (order by (SELECT 1)) rn from t1 ) v Pivot ( Max(col1) For rn In ([1],[2],[3],[4],[5]) ) as P
SQL 演示