with t as( select exam_id,tag,count(start_time) as answer_cnt from exam_record left join examination_info using(exam_id) where upper(tag)!=tag group by 1 having answer_cnt <3), t1 as (select exam_id,tag from exam_record left join examination_info using(exam_id) ) select t.tag as tag ,count(*) as answer_cnt from t inner join t1 on upper(t.tag)=t1.tag group by 1

京公网安备 11010502036488号