2015-07-21 272 views
0

我是SQL Server的新用戶,需要將以下MS Access數據透視查詢轉換爲SQL數據透視查詢。任何幫助將不勝感激。Microsoft Access數據透視表到SQL Server數據透視表

TRANSFORM First(msdgen_pmcat_document_extract_mats.document_text) AS FirstOfdocument_text 
SELECT msdgen_pmcat_document_extract_mats.material_id, msdgen_pmcat_document_extract_mats.documentobject_name, msdgen_pmcat_document_extract_mats.regulatory_code, msdgen_pmcat_document_extract_mats.alternate_name 
FROM msdgen_pmcat_document_extract_mats 
GROUP BY msdgen_pmcat_document_extract_mats.material_id, msdgen_pmcat_document_extract_mats.documentobject_name, msdgen_pmcat_document_extract_mats.regulatory_code, msdgen_pmcat_document_extract_mats.alternate_name 
PIVOT msdgen_pmcat_document_extract_mats.data_type_code; 
+0

那你試試?你遇到了什麼錯誤?你需要展示你如何試圖研究和解決這個問題,以便我們能夠幫助你。 –

+1

你的問題的一部分將是MS Access函數'FIRST()'SQL Server沒有相同的功能。你的表格及其數據在'msdgen_pmcat_document_extract_mats'中是什麼樣子的,你希望最終結果如何顯示? – Taryn

回答