0
我遇到了MS Access中的一個聲明,這是我從未見過的,不知道如何轉換成SQL Server或者它到底在做什麼 - 有誰可以告訴我這是做什麼和可能我將如何轉換爲SQL Server?TRANSFORM訪問SQL到SQL服務器
TRANSFORM Sum([Fcst/Order/Ship Data].Qty) AS SumOfQty
SELECT [Fcst/Order/Ship Data].[Acct Name], [Fcst/Order/Ship Data].[Acct#], [Fcst/Order/Ship Data].Material, [Fcst/Order/Ship Data].Mth
FROM [Fcst/Order/Ship Data]
WHERE ((([Fcst/Order/Ship Data].Year)=2017) AND (([Fcst/Order/Ship Data].Type)="Open_allocated" Or ([Fcst/Order/Ship Data].Type)="shipment" Or ([Fcst/Order/Ship Data].Type)="forecast"))
GROUP BY [Fcst/Order/Ship Data].[Acct Name], [Fcst/Order/Ship Data].[Acct#], [Fcst/Order/Ship Data].Material, [Fcst/Order/Ship Data].Mth
PIVOT [Fcst/Order/Ship Data].Type;
嘗試使用交叉表查詢嚮導。 – Andre
謝謝 - 我很好奇如何或者如果我可以在SQL Server中複製?對我來說都是非常新的 – user3496218
在SQL Server中,它是PIVOT:https://technet.microsoft.com/en-us/library/ms177410(v=sql.105).aspx – Andre