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

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

http://www.nowcoder.com/practice/348afda488554ceb922efd2f3effc427

select user_id ,max(f) ,max(s) ,max(r) from (select if(r=1,date,0) f ,if(r=2,date,0) s ,user_id, date,c,r from (select user_id, date,count(id)over(partition by user_id) c ,rank()over(partition by user_id order by date) r from order_info where date>'2025-10-15' and product_name in('C++','Java','Python') and status='completed' ) a ) b where user_id in (select user_id from (select user_id,min(date) date,count(1) c from order_info where date>'2025-10-15' and product_name in('C++','Java','Python') and status='completed' group by user_id) a where c>=2 ) group by user_id order by user_id

全部评论

相关推荐

10-26 13:03
已编辑
门头沟学院 物流经理
在okr拆解的小太阳...:实习待过,我待的部门氛围很好,基本不加班,双休有保证。
投递正浩创新EcoFlow等公司10个岗位
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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