SELECT u.device_id, u.university, SUM(IF(q.result IS NOT NULL,1,0)) As question_cnt, SUM(IF(q.result='right',1,0)) AS right_question_cnt FROM( SELECT device_id,university FROM user_profile WHERE university='复旦大学' ) AS u LEFT JOIN( SELECT device_id,result FROM question_pract...