题解 | #未完成试卷数大于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-05 21:40
已编辑
北京交通大学 Java
自来熟的放鸽子能手面试中:北京交通大学在这想都不敢想是吧
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务