2011-04-21 95 views
0

問候,我有一個很難該查詢轉換成T-SQL,我希望得到任何幫助Access查詢到T-SQL與樞軸

TRANSFORM Sum(ViewMaster.ServiceCount) AS SumOfServiceCount 
SELECT ViewMaster.Response, Sum(ViewMaster.ServiceCount) AS [Total Of ServiceCount] 
FROM ViewMaster 
GROUP BY ViewMaster.Response 
PIVOT ViewMaster.Month; 
+0

你能給我們一個輸入和輸出的例子嗎? – Lamak 2011-04-21 17:51:50

回答

0

中的東西的行:

SELECT * 
FROM (SELECT Response, ServiceCount, Month 
     FROM ViewMaster) VM 
PIVOT(SUM(ServiceCount) FOR Month IN ('January','February',...,'December'))