1 select * from TbaleOne 2 unpivot(qty for years in ([2002],[2003],[2004])) as up 3 go 4 5 select * from TableTwo 6 unpivot(grate for subject in [kemu]) as up
具体看图
关于sql 的列转行
原文:http://www.cnblogs.com/myblogslh/p/5236880.html