- 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;

京公网安备 11010502036488号