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

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

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

select ee.uid,ee.start_month
,count(ee.uid) as total_cnt
,count(ee.score) as complete_cnt
from 
(select e.uid
,e.start_time,e.score,u.level
,date_format(start_time,"%Y%m") as start_month
,dense_rank() over(partition by uid order by date_format(start_time,"%Y%m") desc) as rk
from exam_record as e left join user_info as u using(uid)) as ee
where ee.uid in 
(select uid from
(select uid
,percent_rank() over (order by round(count(score)/count(uid),4)) as rk
from exam_record
left join examination_info using(exam_id)
where tag="SQL" group by uid) as t0 where rk<=0.5)
and ee.level > 5
and ee.rk<4
group by ee.uid,ee.start_month
order by ee.uid,ee.start_month

全部评论

相关推荐

Yushuu:你的确很厉害,但是有一个小问题:谁问你了?我的意思是,谁在意?我告诉你,根本没人问你,在我们之中0人问了你,我把所有问你的人都请来 party 了,到场人数是0个人,誰问你了?WHO ASKED?谁问汝矣?誰があなたに聞きましたか?누가 물어봤어?我爬上了珠穆朗玛峰也没找到谁问你了,我刚刚潜入了世界上最大的射电望远镜也没开到那个问你的人的盒,在找到谁问你之前我连癌症的解药都发明了出来,我开了最大距离渲染也没找到谁问你了我活在这个被辐射蹂躏了多年的破碎世界的坟墓里目睹全球核战争把人类文明毁灭也没见到谁问你了😆
点赞 评论 收藏
分享
1 收藏 评论
分享
牛客网
牛客企业服务