题解 | #筛选限定昵称成就值活跃日期的用户#
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;

