行转列
SELECT *
FROM student
PIVOT (
SUM(score) FOR subject IN (语文, 数学, 英语)
) AS PivotedData;
列转行
SELECT *
FROM student1
UNPIVOT (
score FOR subject IN ("语文","数学","英语")
)AS PivotedDa
标签:转行,转列,score,MSSQL,SELECT,subject From: https://www.cnblogs.com/jigeqiu/p/18070227