select o.cust_id, sum(i.total_q) total_ordered from Orders o, (select order_num, sum(item_price*quantity) total_q from OrderItems group by order_num) i where o.order_num=i.order_num group by cust_id order by total_ordered desc;