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

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

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

select
u1.device_id,u1.university,count(q.question_id),
sum(case when q.result='right' then 1 else 0 end )
from user_profile u1 left join question_practice_detail q on u1.device_id=q.device_id
WHERE
u1.university='复旦大学'
and
(month(q.date) =8 or month(q.date) is null)
group by u1.device_id

全部评论
看了or,我知道我错哪了
点赞 回复 分享
发布于 2022-07-24 10:46
你这个简洁明了
点赞 回复 分享
发布于 2022-06-07 23:41

相关推荐

评论
18
收藏
分享

创作者周榜

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