先两个表用cust_id连接一下,再与第三个表用order_num连接,然后按条件查询。 由于计算的是每一个订单的总金额,所以不需要分组。 SELECT temp.cust_name, temp.order_num, (quantity* item_price) AS OrderTotal FROM (SELECT cust_name, order_num FROM Customers c JOIN Orders o ON c.cust_id = o.cust_id) AS temp JOIN OrderItems ot ON temp.order_num = ot.order_num O...