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

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

https://www.nowcoder.com/practice/4ae8cff2505f4d7cb68fb0ec7cf80c57

select o.*
from order_info o
where o.user_id in(
    select user_id
    from order_info
    where datediff(date,'2025-10-15')>0
    and product_name in ('C++','Python','Java')
    and status='completed'
    group by user_id
    having count(*)>1
) 
and datediff(o.date,'2025-10-15')>0
and o.product_name in ('C++','Python','Java')
and o.status='completed'
order by o.id
  • 选出符合条件的用户id
  • 记得要重新筛选一遍
全部评论

相关推荐

你背过凌晨4点的八股文么:简历挂了的话会是流程终止,像我一样
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务