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

select
    cust_name,
    sum(total_price) total_price
from
    (
        select
            cust_name,
            item_price * quantity total_price
        from
            OrderItems ori
            join Orders ord on ori.order_num = ord.order_num
            join Customers cus on ord.cust_id = cus.cust_id
    ) a
group by
    cust_name
having
    total_price >= 1000
order by
    total_price

全部评论

相关推荐

07-21 18:43
门头沟学院 Java
是暑期都招满了吗
ANEOY:今年感觉真是后端地狱级难度了,从暑期就是这样,前端需求非常大
点赞 评论 收藏
分享
码农索隆:竞争压力小,就你一个不用卷
点赞 评论 收藏
分享
jnsytgsyqj...:简历跟测试没关系,你更适合运营
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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