题解 | #0级用户高难度试卷的平均用时和平均得分#
0级用户高难度试卷的平均用时和平均得分
https://www.nowcoder.com/practice/bb474c6cbd77478fb6d9fc86934d0ebb
select uid, round(avg(case when score is null then 0 else score end)) as avg_score, round(avg(case when score is null then duration else timestampdiff(minute,start_time,submit_time) end),1) as avg_time_took from exam_record join examination_info using(exam_id) join user_info using(uid) where level = 0 and difficulty = 'hard' group by uid
这个题主要的就是case when的使用和格式调整