题解 | #确定最佳顾客的另一种方式(二)#
确定最佳顾客的另一种方式(二)
https://www.nowcoder.com/practice/b5766f970ae64ac7944f37f5b47107aa
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是因为它不能接聚合函数



