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

相关推荐

04-11 15:34
已编辑
华中科技大学 网络安全
疯犬丨哈士奇:意思就是:我们还有其他更优秀的人在等回复,如果他们不要这个机会就会来找你
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务