select Customers.cust_name ,sum(OrderItems.item_price*OrderItems.quantity)as sumcount from Customers join Orders on Customers.cust_id = Orders.cust_id join OrderItems on Orders.order_num = OrderItems.order_num group by Customers.cust_name having sumcount>=1000
sum goup by having
不能用where是因为它不能接聚合函数