题解 | #统计复旦用户8月练题情况#
统计复旦用户8月练题情况
https://www.nowcoder.com/practice/53235096538a456b9220fce120c062b3
select us.device_id ,us.university ,count(qu.question_id) ,sum(if(qu.result='right',1,0)) from user_profile as us left join question_practice_detail as qu on us.device_id = qu.device_id where us.university = '复旦大学' and (month(date) = 8 or date is null) group by us.device_id