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

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

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

SELECT 
    up.device_id,
    up.university,
    count(question_id) AS question_cnt,
    SUM(IF(qpd.result = 'right', 1, 0)) AS right_question_cnt
FROM
    user_profile AS up
    LEFT JOIN question_practice_detail AS qpd ON qpd.device_id = up.device_id
    AND MONTH(qpd.date) = 8
WHERE
    up.university = '复旦大学'
GROUP BY
    up.device_id

全部评论

相关推荐

M_bao:换个排版吧哥们,看着费劲
点赞 评论 收藏
分享
10-06 12:46
门头沟学院 Java
跨考小白:定时任务启动
点赞 评论 收藏
分享
评论
1
收藏
分享
牛客网
牛客企业服务