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

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

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

SELECT uid, count(IF(submit_time is null,1,NULL)) AS imcomplete_cnt,

sum(IF(submit_time is not null,1,0)) as complete_cnt, GROUP_CONCAT(DISTINCT concat_ws(':', date(start_time), tag) SEPARATOR ';') as detail

FROM exam_record JOIN examination_info using(exam_id) WHERE YEAR(start_time)='2021' GROUP BY uid

HAVING imcomplete_cnt>1 and imcomplete_cnt<5 and complete_cnt>=1

ORDER BY imcomplete_cnt DESC

全部评论

相关推荐

10-24 11:10
山西大学 Java
若梦难了:哥们,面试挂是很正常的。我大中厂终面挂,加起来快10次了,继续努力吧。
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务