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

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

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

利用rlike进行模糊查询,在利用正则表达式进行匹配。

SELECT uid,
exam_id,
round(AVG(score),0) as avg_score
from exam_record
where uid IN
(SELECT uid
from user_info
where nick_name rlike '^牛客[0-9]+号$' or nick_name rlike '^[0-9]+$')
and 
exam_id IN
 (select exam_id
    from examination_info
    where tag RLIKE '^(C|c).*'
)
and score is not NULL
group by uid,exam_id
order by uid,avg_score;
全部评论

相关推荐

ddd7_:跟我一模一样,加微信的hr都同一个,扫码了白年书人查看图片
点赞 评论 收藏
分享
11-03 17:57
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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