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

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

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

#先选出满足条件的用户 select uid from( select t1.uid ,unfinish_ratio ,row_number() over(order by unfinish_ratio desc) rank_1 ,cnt ,ui.level FROM ( select er.uid, 1-count(submit_time)/count(start_time) as unfinish_ratio from exam_record er inner join user_info ui on er.uid = ui.uid group by er.uid) t1 join (select count(distinct uid) as cnt from user_info) t2 join user_info ui on t1.uid = ui.uid) t3 where rank_1 <= ceil(cnt * 0.5) and level in (6,7)

#筛选每个用户在有试卷做大记录的近三个月中,每个月的答卷数目和完成数目。 select uid ,time_month as start_month ,cnt as total_cnt , finish_cnt as complete_cnt from( select

,row_number() over(partition by uid order by time_month desc) as rank_1 from( select h1.uid ,date_format(start_time,"%Y%m") as time_month ,count(start_time) as cnt ,count(submit_time) as finish_cnt from exam_record inner JOIN (select uid from( select t1.uid ,unfinish_ratio ,row_number() over(order by unfinish_ratio desc) rank_1 ,cnt ,ui.level FROM ( select er.uid, 1-count(submit_time)/count(start_time) as unfinish_ratio from exam_record er inner join user_info ui on er.uid = ui.uid group by er.uid) t1 join (select count(distinct uid) as cnt from user_info) t2 join user_info ui on t1.uid = ui.uid) t3 where rank_1 <= ceil(cnt * 0.5) and level in (6,7)) h1 on exam_record.uid = h1.uid group by uid,date_format(start_time,"%Y%m"))t1 ) t2 where rank_1 <= 3 order by uid asc,time_month asc

全部评论

相关推荐

沉淀一会:1.同学你面试评价不错,概率很大,请耐心等待; 2.你的排名比较靠前,不要担心,耐心等待; 3.问题不大,正在审批,不要着急签其他公司,等等我们! 4.预计9月中下旬,安心过节; 5.下周会有结果,请耐心等待下; 6.可能国庆节前后,一有结果我马上通知你; 7.预计10月中旬,再坚持一下; 8.正在走流程,就这两天了; 9.同学,结果我也不知道,你如果查到了也告诉我一声; 10.同学你出线不明朗,建议签其他公司保底! 11.同学你找了哪些公司,我也在找工作。
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
10-05 10:13
已编辑
HHHHaos:让这些老登来现在秋招一下,简历都过不去
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务