题解 | #确定最佳顾客的另一种方式(二)#
确定最佳顾客的另一种方式(二)
https://www.nowcoder.com/practice/b5766f970ae64ac7944f37f5b47107aa
与97题差不多,加入了条件筛选,减少了一个分组
select cust_name,sum(quantity*item_price) as total_price from Customers t inner join Orders t1 on t.cust_id = t1.cust_id inner join OrderItems t2 on t1.order_num = t2.order_num group by cust_name having total_price >=1000 order by cust_name
综合测试