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

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

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

select o.user_id,min(o.date) first_buy_date,count(o.product_name) cnt
from order_info o 
join 
    (select distinct user_id
    from order_info 
    where date > '2025-10-15' 
                 and status = 'completed' 
                 and product_name in ("C++","Java","Python")
    group by user_id
    having count(user_id) >= 2) t
on o.user_id = t.user_id
where product_name in ("C++","Java","Python")
        and status = 'completed'
        and date > '2025-10-15'
group by o.user_id
order by o.user_id;
全部评论

相关推荐

安静的垂耳兔在泡澡:ks已经第八次投递了,它起码挂了还让你再投,不错了
点赞 评论 收藏
分享
无情咸鱼王的秋招日记之薛定谔的Offer:好拒信,偷了,希望有机会用到
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务