题解 | 查询连续登陆的用户

查询连续登陆的用户

https://www.nowcoder.com/practice/9944210610ec417e94140ac09512a3f5

select t1.l_user from(
    select 
            l.user_id as l_user, r.user_id as r_user, 
            row_number()over(partition by l.user_id order by date(l.log_time)) as rn
        from 
            login_tb l left join register_tb r
        on 
            l.user_id = r.user_id
        where 
            l.user_id = r.user_id
    )t1
where 
    t1.rn >= 3
    


全部评论

相关推荐

Morpheus_:同 好奇什么题() 不过我一面确实是不想要直说了 xs
腾讯求职进展汇总
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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