题解 | #筛选昵称规则和试卷规则的作答记录#

筛选昵称规则和试卷规则的作答记录

https://www.nowcoder.com/practice/1c5075503ccf4de1882976b2fff2c072

with uid_f_use as (
    select uid
    from user_info
    where nick_name rlike '^牛客[0-9]+号$'
    or nick_name regexp '^[0-9]+$'
), 
    exam_f_use as (
    select exam_id
    from examination_info
    where tag regexp '^[Cc]'
)
    select uid, exam_id, round(avg(score),0) as avg_score
    from exam_record
    where submit_time is not null
    and exam_id in (select exam_id from exam_f_use)
    and uid in (select uid from uid_f_use)
    group by uid, exam_id
    order by uid, avg_score
rlike 和 expexp 的使用,不理解为什么要用 + ,还要再学习一下
全部评论

相关推荐

2025-12-27 22:35
门头沟学院 Java
点赞 评论 收藏
分享
2025-12-20 13:19
已编辑
曲阜师范大学 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务