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

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

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

写了一个冗余的版本,但为什么报错呢,不理解。。。

select device_id,university,count(question_id) question_cnt,sum(res) right_question_cnt
from
(select u.device_id,u.university,qp.question_id,    qp.result,IF(qp.result='right',1,0)) as res
from user_profile u left join question_practice_detail qp on device_id
where month(qp.date)=8 and u.university='复旦大学') as k
group by device_id

全部评论

相关推荐

04-13 18:10
门头沟学院 Java
想熬夜的小飞象在秋招:被腾讯挂了后爸妈以为我失联了
点赞 评论 收藏
分享
评论
2
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务