题解 | #试卷发布当天作答人数和平均分#

试卷发布当天作答人数和平均分

http://www.nowcoder.com/practice/5b58e89556dc4153a79d8cf8c08ba499


select t.exam_id,count(distinct e1.uid) as uv 
,round(avg(e1.score),1) as avg_score
from exam_record e1 
join 
(
    select exam_id,release_time
    from examination_info
    where tag="SQL"
) t
on t.exam_id = e1.exam_id
join user_info e2 
on e1.uid=e2.uid
where e2.level>5
and date_format(t.release_time,"%Y%m%d")=date_format(e1.start_time,"%Y%m%d")
group by t.exam_id
order by uv desc,avg_score 

全部评论

相关推荐

Hello_WordN:咱就是说,除了生命其他都是小事,希望面试官平安,希望各位平时也多注意安全
点赞 评论 收藏
分享
2 收藏 评论
分享
牛客网
牛客企业服务