使用多个表将Access TRANSFORM / PIVOT查询转换为SQL Server

时间:2019-04-17 17:13:31

标签: sql-server ms-access

需要将该查询转换为sql server。我尝试了几个例子,但它们对我没有用。

TRANSFORM Sum(CUST_ORDER_LINE.ORDER_QTY) AS SumOfORDER_QTY
SELECT CUST_ORDER_LINE.PART_ID
FROM CUSTOMER_ORDER LEFT JOIN CUST_ORDER_LINE ON CUSTOMER_ORDER.ID = CUST_ORDER_LINE.CUST_ORDER_ID
WHERE (((CUST_ORDER_LINE.PART_ID) Is Not Null) AND ((CUSTOMER_ORDER.STATUS) In ('F','R')))
GROUP BY CUST_ORDER_LINE.PART_ID
PIVOT CUSTOMER_ORDER.STATUS

0 个答案:

没有答案