我想从表 PRODUCT_INFORMATION 中选择所有内容。我尝试使用 p.* 和 PRODUCT_INFORMATION.* 但它不起作用?我的错误在哪里?与JOIN有关吗?
SELECT
p.PRODUCT_NAME ,
SUM (oi.QUANTITY) TOTAL_QUANTITY,
o.ORDER_MODE
FROM PRODUCT_INFORMATION p
LEFT JOIN ORDER_ITEMS oi ON p.PRODUCT_ID = oi.PRODUCT_ID
LEFT JOIN ORDERS o ON o.ORDER_ID = oi.ORDER_ID
WHERE INSTR (p.PRODUCT_NAME, '<') = 0
AND INSTR (p.PRODUCT_NAME, '_') = 0
GROUP BY p.PRODUCT_NAME, p.WARRANTY_PERIOD, o.ORDER_MODE
HAVING SUM (oi.QUANTITY) > 200
ORDER BY p.WARRANTY_PERIOD;