题解 | #统计复旦用户8月练题情况#
统计复旦用户8月练题情况
https://www.nowcoder.com/practice/53235096538a456b9220fce120c062b3
select aa.device_id,university ,(select count(a.question_id) from question_practice_detail a where month(a.date) = 8 and a.device_id = aa.device_id ) question_cnt ,(select count(a.result) from question_practice_detail a where month(a.date) = 8 and a.device_id = aa.device_id and result = 'right' ) right_question_cnt from user_profile aa where aa.university = '复旦大学'