题解 | #筛选限定昵称成就值活跃日期的用户#

筛选限定昵称成就值活跃日期的用户

https://www.nowcoder.com/practice/2ed07ff8f67a474d90523b88402e401b

with last_act as (
    select uid, time_in_use
        , row_number()over(partition by uid order by time_in_use desc) as time_rank
    from (
        select uid, date_format(start_time, '%Y%m') as time_in_use
        from exam_record
        union all
        select uid, date_format(submit_time, '%Y%m') as time_in_use
        from practice_record
        ) a 
)
    select uid
        , nick_name
        , achievement
    from user_info
    where nick_name like '牛客%号'
    and achievement between 1200 and 2500
    and uid in (
            select uid 
            from last_act 
            where time_in_use = '202109' 
            and time_rank = 1)

全部评论

相关推荐

强大的马里奥:不太可能,我校计算机硕士就业率99%
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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