答案 0 :(得分:0)
检查表名是否正确并尝试:
SELECT o.order_number, o.item_quantity, p.price,(o.item_quantity * p.price) AS subtotal, SUM( o.item_quantity * p.price) AS total
FROM order AS o
LEFT JOIN product AS p ON product_number = idproduct_detail;
有了这个,我将每个订单与相关产品连接,然后选择item_quantity和price并将它们的产品相加。