select m.device_id,m.university,if(n.question_cnt is null,0,n.question_cnt) as question_cnt,if(n.right_question_cn is null,0,n.right_question_cn)as right_question_cnt from (select distinct device_id,university from user_profile where university='复旦大学')m left join (select c.device_id,count(c.question...