select C.cust_name,O.order_num,sum(OI.quantity * OI.item_price) OrderTotal from Customers C join Orders O on C.cust_id =O.cust_id join OrderItems OI on O.order_num = OI.order_num group by C.cust_name,O.order_num order by C.cust_name asc,O.order_num asc 将表1跟表2进行关联,然后再跟表3关联,关联后进行查询