原始表为:
pivot纵表转横标:
select * from Test7 pivot (sum (score) for course in (数学,语文,物理)) as t2
结果:
unpivot横标转纵表: