select up.device_id,up.university,count(qpd.question_id) as question_cnt, sum(if(qpd.result='right',1,0)) as right_question_cnt from user_profile as up left join question_practice_detail as qpd on up.device_id=qpd.device_id and month(qpd.date)=8 where university='复旦大学' group by device_id 注意左连接时候,不能...