题解 | #未完成试卷数大于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

全部评论

相关推荐

一天代码十万三:这个学历有中大厂实习也是0面,没办法,斩杀线是这样的
点赞 评论 收藏
分享
10-20 11:11
辽宁大学 营销
点赞 评论 收藏
分享
想玩飞盘的菠萝蜜在春...:上交✌🏻也拒?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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