select cust_id, total_price from Orders a join (select order_num, sum(item_price*quantity) total_price from OrderItems group by order_num) b on a.order_num = b.order_num order by total_price desc;