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

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

全部评论

相关推荐

不愿透露姓名的神秘牛友
今天 13:59
点赞 评论 收藏
分享
程序员小白条:你是沟通了900个,不是投了900份简历,你能投900份,意味着对面都要回复你900次,你早就找到实习了,没亮点就是这样的,别局限地区,时间投的也要早,现在都要7月了
点赞 评论 收藏
分享
Twilight_m...:还是不够贴近现实,中关村那块60平房子200万怎么可能拿的下来,交个首付还差不多
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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