NN
你能帮我一下数据透视表吗?由于某种原因,它返回全零!我的代码是
SELECT VendorID, ['Y'] , ['N']
FROM
(SELECT
VendorSiteID,
Local,
VendorID
FROM [DB]) p
PIVOT
(
COUNT (VendorSiteID)
FOR Local IN
( ['Y'], ['N'] )
) AS pvt
order by [VendorID]
我的样本数据是
我不得不删除引号,一切都在工作!