select user_id, active_dt, if(count = 3,rank,1) active_days from ( select user_id,active_dt,rank, count(*)over(partition by user_id,sub_date) count from ( select user_id,active_dt,rank, (cast(active_dt as bigint) - rank) sub_date from (select user_id,active_dt, rank() over (partition by user_id order by active_dt) rank from table1) t1 ) t2 ) t3

相关推荐

纯真的河老师在喝茶:第一个是这个时间点岗位少,第二个是这个简历重复度太高了,10个有9个简历差不多的
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务