# 使用sum()统计未作答完试卷次数,可理解为产生了一个新的列放入sum括号里面的条件判断值后再加和 select count(*) total_pv, sum(submit_time is not null) complete_pv, (select count(distinct exam_id) from exam_record where submit_time is not null) complete_exam_cnt from exam_record;