题解 | #牛客的课程订单分析(四)#

牛客的课程订单分析(四)

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

select
    distinct 
    user_id,
    min(date) over(partition by user_id order by date) first_buy_date,
    count(*) over(partition by user_id) cnt
from
    (
        select
            *    
        from
            (
                select
                    *,
                    count(*) over(partition by user_id) num
                from 
                    (
                        select
                            *
                        from
                            order_info o 
                        where
                            date > "2025-10-15" and
                            product_name in("C++","Java","Python") and
                            status = "completed"
                    ) t
            ) t
        where
            num >= 2
    ) t
order by
    user_id
全部评论

相关推荐

对空六翼:你真幸运,碰见这么好的人,不像我,秋招的时候被室友骗进cx了
实习好累,可以辞职全力准...
点赞 评论 收藏
分享
程序员花海_:项目描述写的太少了 多写一点 先写业务 再写技术
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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