题解 | #统计有未完成状态的试卷的未完成数和未完成率#
统计有未完成状态的试卷的未完成数和未完成率
https://www.nowcoder.com/practice/69fc2b1df4144c0991e4b8280d8aba27
这题简单
select
exam_id,
count(start_time) - count(submit_time) incomplete_cnt,#sum(if(score is null, 1, 0)
round((count(start_time) - count(submit_time))/count(start_time),3) complete_rate
from
exam_record
group by exam_id
having incomplete_cnt >= 1
