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

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

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

# select device_id 
# from user_profile
# where month(date)=8
# group by device_id



select e3.device_id,e3.university,count(question_id),sum(if(result='right',1,0))
from (
    select e1.device_id,e1.university,e2.question_id,e2.result
    from(select device_id,university from user_profile where university ='复旦大学') e1
    left join  (select * from question_practice_detail where month(question_practice_detail.date)=8 ) as e2
    on e1.device_id=e2.device_id
) e3
group by e3.device_id

全部评论

相关推荐

05-22 09:23
门头沟学院 Java
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
07-09 12:11
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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