我有以下表格:
VENDOR: PRODUCT: ITEM: STORE:
- VENDOR_ID - PRODUCT_ID - ITEM_ID - STORE_ID
- VENDOR_NAME - PRODUCT_DESC - STORE_ID - STORE_NAME
- VENDOR_ID - PRODUCT_ID - STORE_LOCATION
- ITEM_PRICE
我想执行以下连接操作,但我不确定如何使用 Access SQL 对其进行格式化
SELECT DISTINCT VENDOR.VENDOR_NAME, COUNT(ITEM.PRODUCT_CODE)
FROM VENDOR INNER JOIN PRODUCT ON VENDOR.VENDOR_ID = PRODUCT.VENDOR_ID
INNER JOIN ITEM ON PRODUCT.PRODUCT_ID = ITEM.PRODUCT_ID
GROUP BY VENDOR.VENDOR_NAME
ORDER BY COUNT(ITEM.PRODUCT_ID) DESC;
你能告诉我像这样嵌套 INNER JOIN 的正确方法吗?我正在使用访问!