题解 | #未完成率较高的50%用户近三个月答卷情况#

未完成率较高的50%用户近三个月答卷情况

https://www.nowcoder.com/practice/3e598a2dcd854db8b1a3c48e5904fe1c

select uid,start_month,total_cnt,complete_cnt
from
(select 
    uid,
    date_format(start_time,'%Y%m') as start_month,
    rank() over (partition by uid order by date_format(start_time,'%Y%m') desc) as ranking,
    count(start_time) as total_cnt,
    count(submit_time) as complete_cnt
from exam_record
group by uid,date_format(start_time,'%Y%m')) tb3
join
(select uid 
from
    (select 
         uid,
         percent_rank() over(order by sum(if(score is null,1,0)) /count(start_time) desc) as rnk
     from exam_record er1
     group by uid) tb1 
join user_info using(uid)
where rnk <= 0.5 and level in (6,7))tb2 using(uid)
where ranking <= 3
order by uid,start_month

全部评论

相关推荐

投递拓竹科技等公司10个岗位
点赞 评论 收藏
分享
07-25 10:31
门头沟学院 Java
求问各位大佬,笔试都考点啥
投递科大讯飞等公司10个岗位
点赞 评论 收藏
分享
一表renzha:手写数字识别就是一个作业而已
点赞 评论 收藏
分享
在等offer的火锅...:我去履历这么好,都找不到工作吗?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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