****用的join 也行 select o.cust_id, sum(item_price * quantity )as total_order from Orders o inner join OrderItems oi on oi.order_num = o.order_num group by o.cust_id order by total_order desc