题解 | #浙大不同难度题目的正确率#
浙大不同难度题目的正确率
https://www.nowcoder.com/practice/d8a4f7b1ded04948b5435a45f03ead8c
select difficult_level, avg(if(result='right',1,0)) as correct_rate from (select b.device_id,b.question_id,b.result, c.difficult_level from ( select device_id, question_id, result from question_practice_detail ) b join question_detail c on b.question_id = c.question_id join user_profile a on b.device_id = a.device_id and university = '浙江大学') p group by difficult_level order by correct_rate;
用了两次子查询 可能有点儿麻烦
select 之后加distinct会报错 不知道为什么