题解 | #确定最佳顾客的另一种方式(二)#

确定最佳顾客的另一种方式(二)

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

综合测试

全部评论
我也觉得这种是最佳实践
点赞 回复 分享
发布于 2022-10-03 21:44 江苏

相关推荐

03-17 23:54
黑龙江大学 Java
来个白菜也好啊qaq:可以的,大厂有的缺打手
点赞 评论 收藏
分享
评论
10
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务