也许是这样的:
测试数据
DECLARE @T TABLE(Col1 INT, Col2 INT, Col3 INT)INSERT INTO @TVALUES (1,1,1)
询问
SELECt *FROM( SELECt t.Col1, t.Col2, t.Col3 FROM @T AS t) AS SourceTableUNPIVOT( Value FOR Col IN (Col1,Col2,Col3)) AS unpvt
输出
1 Col11 Col21 Col3
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)