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

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

http://www.nowcoder.com/practice/4ca4137cb490420cad06d2147ae67456

select user_id
from order_info
where datediff(date,"2025-10-15")>0
  and status = "completed"
  and product_name in("C++","Java","Python")
group by user_id
having count(id)>=2
order by user_id
select oi1.user_id 
from order_info oi1
left join (
    select oi2.user_id , count(user_id) cnt
    from order_info oi2
    group by oi2.user_id
) x using (user_id)
where datediff(date,"2025-10-15")>0
    and status ="completed"
    and product_name in("C++","Java","Python")
    and x.cnt >= 2
    group by oi1.user_id
全部评论

相关推荐

11-08 16:53
门头沟学院 C++
投票
滑模小马达:第三个如果是qfqc感觉还行,我签的qfkj搞电机的,违约金也很高,但公司感觉还可以,听说之前开过一个试用转正的应届生,仅供参考。
点赞 评论 收藏
分享
11-29 11:21
门头沟学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务