sql 将横的记录显示为竖的记录 max(case when CASE ltrim(ps.SIZE) WHEN '4.5' THEN ps.PairPerCarton END is null then null else ps.PairPerCarton end ) AS [4.5]

max(case when CASE ltrim(ps.SIZE) WHEN '4.5' THEN ps.PairPerCarton END is null then null else ps.PairPerCarton end ) AS [4.5],
max(case when CASE ltrim(ps.SIZE) WHEN '5' THEN ps.PairPerCarton END is null then null else ps.PairPerCarton end ) AS [5],

原文地址:https://www.cnblogs.com/buy0769/p/3373353.html