1.行转列 PIVOT函数,行转列,列转换UNPIVOT select * from ShoppingCart as C PIVOT(count(TotalPrice) FOR [Week] IN([1],[2],[3],[4],[5],[6],[7])) AS T https://www.cnblogs.com/linJie1930906722/p/6036714.htmlhttps://www.cnblogs.com/wlsandwho/p/4423956.htmlhttps://www.c