题解 | 近三个月未完成试卷数为0的用户完成情况

近三个月未完成试卷数为0的用户完成情况

https://www.nowcoder.com/practice/4a3acb02b34a4ecf9045cefbc05453fa

with t as (
select uid,dt from(
select uid,dt,row_number() over(partition by uid order by dt desc) as rk from(
select distinct DATE_FORMAT(start_time,'%Y-%m') as dt,uid from exam_record) tmp ) a where rk<=3)

select uid,a1 as exam_complete_cnt from(
select t.uid,count(start_time) as a1,count(submit_time) as a2 from exam_record e right join t on t.uid=e.uid and dt=DATE_FORMAT(start_time,'%Y-%m') group by 1 having a1=a2) tmp order by 2 desc,1 desc

全部评论

相关推荐

FFFoly:我也是,现在已经到了学长说的 能面试侃侃而谈的阶段了,但是已经没有公司给我面了
远程面试的尴尬瞬间
点赞 评论 收藏
分享
11-13 12:02
门头沟学院 Java
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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