PIVOT

SELECT *

from (select distinct sls_q,to_party_id,to_party_nm,sub_brand,cast(sub_brand as varchar) sub_brand,sku,sls_qty from sls )
PIVOT(max(sls_qty) AS sls_qty FOR sub_brand IN ('zz','ee','hh')) TMP

where to_party_id in (xxx)

 

posted @ 2024-05-28 10:25  未必是小小  阅读(33)  评论(0编辑  收藏  举报