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