题解 | 统计复旦用户8月练题情况
select t1.device_id ,university ,sum(case when month(date) = 8 then 1 else 0 end) as question_cnt ,sum(if(result = 'right',1,0)) as right_question_cnt from user_profile t1 left join question_practice_detail t2 on t1.device_id = t2.device_id where university = '复旦大学' group by t1.device_id