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

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

  • rlike(正则表达式)的写法:^牛客.*号$
  • like的写法:牛客%号
select
    t1.uid, t2.nick_name, t2.achievement
from (
    select
        uid
    from (
        select
            uid, date_format(start_time, '%Y%m') as dt
        from exam_record
        union all
        select 
            uid, date_format(submit_time, '%Y%m') as dt
        from practice_record
    ) as t
    group by uid
    having max(dt) = '202109'
) as t1
    left join user_info as t2 on t1.uid = t2.uid
where
    t2.nick_name rlike '^牛客.*号$'
    and t2.achievement between 1200 and 2500;
全部评论

相关推荐

点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务