题解 | #筛选限定昵称成就值活跃日期的用户#
筛选限定昵称成就值活跃日期的用户
http://www.nowcoder.com/practice/2ed07ff8f67a474d90523b88402e401b
- SELECT uid , nick_name , achievement
- FROM user_info
- WHERE nick_name LIKE '牛客%号' AND achievement BETWEEN 1200 AND 2500
- AND uid IN
- (SELECT er.uid
- FROM exam_record er LEFT JOIN practice_record pr
- ON er.uid = pr.uid
- GROUP BY uid
- HAVING max(date_format(start_time,'%Y%m')) = 202109
- OR max(date_format(pr.submit_time,'%Y%m')) = 202109)