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

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

https://www.nowcoder.com/practice/b5766f970ae64ac7944f37f5b47107aa

select c.cust_name, A.total_price
from Customers c 
inner join (select o.cust_id, sum(oi.item_price*quantity*1.000) total_price
from OrderItems oi
inner join Orders o
on oi.order_num = o.order_num
group by o.cust_id
) A
on A.cust_id = c.cust_id
where A.total_price >= 1000
order by A.total_price
#数据每一行都能互相匹配,所以连接方式对结果并没有什么影响

全部评论

相关推荐

“校招”、“3-5年经验”
飞花断音:小公司招逆向的不要去,基本上都是搞黑灰产违法的东西
点赞 评论 收藏
分享
仁者伍敌:难怪小公司那么挑剔,让你们这些大佬把位置拿了
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
2
收藏
分享

创作者周榜

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