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

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

  • 正则表达式写法(感觉写复杂了...)
    select
      t1.uid,
      t1.exam_id,
      round(avg(t1.score), 0) as avg_score
    from exam_record as t1
      left join examination_info as t2 on t1.exam_id = t2.exam_id
      left join user_info as t3 on t1.uid = t3.uid
    where 
      t1.score is not null
      and (t3.nick_name rlike '^牛客[0-9]{1,}号$'
      or t3.nick_name rlike '^[0-9]{1,}$')
      and t2.tag rlike '^[c, C].{0,}'
    group by t1.uid, t1.exam_id
    order by t1.uid, avg_score;
全部评论

相关推荐

点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
05-28 12:15
点赞 评论 收藏
分享
认真搞学习:这么良心的老板真少见
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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