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

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

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

select device_id, university, sum(question), sum(right_question)
from (
select a.device_id as device_id, a.university as university,
       case when question_id is not NULL then 1
            when question_id is NULL then 0
            end question, result,
       case when result="right" then 1
            else 0
            end right_question,
        date
from user_profile as a

left join question_practice_detail as b
on a.device_id= b.device_id
where university="复旦大学" ) as c
where month(date)=8 or date is null
group by device_id, university

全部评论

相关推荐

01-30 09:45
燕山大学 Java
喵_coding:这种直接跑就完事了 哪有毕业了才签合同 任何offer和三方都没有的
点赞 评论 收藏
分享
卡卡罗特ovo:说起云智我就来气,约好了一面,结果面试官没来,ssob上问hr也未读,我还是专门请了半天假在家面试,恶心死了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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