2015-07-21 270 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

回答