先放上代码: select c.difficult_level, sum(if(b.result='right',1,0))/count(b.result) as correct_rate from question_practice_detail b left join user_profile a on a.device_id=b.device_id left join question_detail&nbs...