窗口函数增加新的排序一列 之后case when select a.user_id,a.active_dt,a.active_days from (select *, (case when active_day<=3 then active_day else 1 end)active_days from( select user_id, active_dt, row_number() over (partition by user_id order by active_dt )as active_day from table1) t)a ;
点赞 评论

相关推荐

头像
04-09 14:29
Java
点赞 评论 收藏
转发
牛客网
牛客企业服务