答案 0 :(得分:0)
SELECT
*
FROM
(
SELECT * FROM woddb.cityStock_Unpivot
) AS tblCity
UNPIVOT
(
OutputValue FOR [OutputFieldName] IN (Sales, stock, [Target])
) AS UNPVT
PIVOT
(
SUM(OutputValue)
For Category IN (Panel,ac,ref)
) AS PVT