SELECT cust_id,(SELECT SUM(item_price*quantity) FROM OrderItems #子查询对每个订单计算一次SUM()WHERE OrderItems.order_num=Orders.order_num) as total_order # 子查询创建计算列FROM OrdersORDER BY total_order desc # order by 执行次序在 ...