SELECT o.cust_id cust_id, tb.total_ordered total_ordered FROM ( SELECT order_num, SUM(item_price * quantity) total_ordered FROM OrderItems GROUP BY order_num ) tb, Orders o WHERE tb.order_num = o.order_num ORDER BY total_ordered DESC;
SELECT o.cust_id cust_id, tb.total_ordered total_ordered FROM ( SELECT order_num, SUM(item_price * quantity) total_ordered FROM OrderItems GROUP BY order_num ) tb, Orders o WHERE tb.order_num = o.order_num ORDER BY total_ordered DESC;