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

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

 SELECT
    up.device_id,
    up.university,
    count( question_id ) AS question_cnt,
    ( SELECT COUNT(*) FROM question_practice_detail WHERE result = "right" AND device_id = up.device_id  ) AS right_question_cnt
FROM
    user_profile up
    LEFT JOIN question_practice_detail qpd ON up.device_id = qpd.device_id  AND MONTH ( qpd.date ) = 8 
WHERE
    university = "复旦大学"  
GROUP BY
    up.device_id
全部评论

相关推荐

比亚迪汽车新技术研究院 硬件工程师 总包21左右 硕士
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务