题解 | #统计复旦用户8月练题情况#

统计复旦用户8月练题情况

https://www.nowcoder.com/practice/53235096538a456b9220fce120c062b3

select a.device_id,university,sum(if(b.question_id is not null,1,0)),sum(if(result='right',1,0)) from
( select device_id,university from user_profile where university = '复旦大学' ) as a
left join 
( select device_id,question_id,result,date from question_practice_detail where Month(date)=8 ) as b
on a.device_id = b.device_id 
group by device_id,university;

对于求回答问题数,没有想到更好的解答,有大神能指导的吗

全部评论

相关推荐

评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务