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

select *
from order_info
where user_id in 
    (select a.user_id
       from 
          (select user_id, count(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
          ) a 
    ) #该条件为找到符合要求的用户id
and date>'2025-10-15' and status='completed' and product_name in ('C++','Java','Python')
order by id asc


全部评论

相关推荐

牛马人的牛马人生:一开始看成了网吧
点赞 评论 收藏
分享
SaviorSu:直接说下学期可以请假,一般情况学校允许我26届,大三就直接去实习了
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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