题解 | #未完成试卷数大于1的有效用户#

未完成试卷数大于1的有效用户

https://www.nowcoder.com/practice/46cb7a33f7204f3ba7f6536d2fc04286

select uid,
    sum(if(score is not null and submit_time is not null,0,1)) incomplete_cnt,
    sum(if(score is not null and submit_time is not null,1,0)) complete_cnt,
    group_concat(distinct concat(date(start_time),':',tag) order by start_time asc SEPARATOR ';' )

from examination_info ei 
left join exam_record er using(exam_id)
where start_time >='2021-01-01'
group by 1
having incomplete_cnt<5 and complete_cnt>=1 and incomplete_cnt>1
order by incomplete_cnt desc

全部评论

相关推荐

不愿透露姓名的神秘牛友
11-07 20:21
签耀等华
双非硬上算法:我咋那么想举办你呢,铁铁
点赞 评论 收藏
分享
点赞 评论 收藏
分享
offer小狗:发牛客的时候把别人的昵称和头像都打个码吧
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务