题解 | #筛选限定昵称成就值活跃日期的用户#

筛选限定昵称成就值活跃日期的用户

http://www.nowcoder.com/practice/2ed07ff8f67a474d90523b88402e401b

#先筛选出uid,其应满足最近一次试卷或练习在2021年9月,在从第一个表找其他满足条件的字段
select uid,nick_name,achievement
from user_info
where uid in 
(
    select uid
    from exam_record
    group by uid
    having max(date_format(start_time,'%Y%m'))=202109
    union
    select uid
    from practice_record
    group by uid
    having max(date_format(submit_time,'%Y%m'))=202109
)
and nick_name like '牛客%号'
and achievement between 1200 and 2500

全部评论

相关推荐

10-15 09:13
已编辑
天津大学 soc前端设计
点赞 评论 收藏
分享
牛客279957775号:铁暗恋
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务