题解 | #筛选限定昵称成就值活跃日期的用户#
筛选限定昵称成就值活跃日期的用户
https://www.nowcoder.com/practice/2ed07ff8f67a474d90523b88402e401b
select
distinct tp.uid as uid,
t3.nick_name as nick_name,
t3.achievement as achievement
from
(
select
id,
uid,
exam_id as id_3,
start_time as id_4,
score
from
exam_record as t1
union
select
id,
uid,
question_id as id_3,
submit_time as id_4,
score
from
practice_record as t2
) as tp
inner join user_info as t3 on tp.uid = t3.uid
where
date_format (tp.id_4, '%Y-%m') = '2021-09'
and t3.nick_name like '牛客%号'
and t3.achievement between 1200 and 2500;

