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

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

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

select device_id,university,
sum(case when question_id is not null then 1 else 0 end) as question_cnt,
sum(case when result = "right" then 1 else 0 end) as right_question_cnt
from (
	select u.device_id,university,question_id,result
	from user_profile u
	left join question_practice_detail q on u.device_id = q.device_id
	where university = "复旦大学" and (month(date) = 8 or date is null)
) t1
group by device_id,university;

全部评论

相关推荐

03-26 12:00
已编辑
门头沟学院 Java
offer魅魔_oc...:100-200每天,你还要倒贴100
点赞 评论 收藏
分享
Rac000n:淘天-客户运营部-AI研发工程师,智能客服方向,暑期实习招聘,欢迎联系
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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