题解 | #未完成试卷数大于1的有效用户#
未完成试卷数大于1的有效用户
https://www.nowcoder.com/practice/46cb7a33f7204f3ba7f6536d2fc04286
select
uid
,count(start_time)-count(submit_time) incomplete_cnt
,count(submit_time) complete_cnt
,replace(group_concat(distinct(left(start_time,10)),':',tag),',',';') detail
from exam_record re
join examination_info fo
on re.exam_id = fo.exam_id
where start_time is not null
and start_time like "2021%"
group by 1
having complete_cnt >= 1
and incomplete_cnt < 5
and incomplete_cnt > 1
order by incomplete_cnt desc
查看1道真题和解析