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

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

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

全部评论

相关推荐

joe2333:怀念以前大家拿华为当保底的日子
点赞 评论 收藏
分享
11-15 18:39
已编辑
西安交通大学 Java
全村最靓的仔仔:卧槽,佬啥bg呢,本也是西交么
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务