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

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

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
#数据每一行都能互相匹配,所以连接方式对结果并没有什么影响

全部评论

相关推荐

政委qqq:这道题在算法竞赛里唯一考的就是高精度,但是只能难住C++这类语言,Python直接a+b秒天秒地
点赞 评论 收藏
分享
评论
2
收藏
分享

创作者周榜

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