select exam_record.uid, count(distinct exam_record.exam_id) as exam_cnt, count(distinct t1.question_id,t1.submit_time) as question_cnt from exam_record left join (select * from practice_record where year(submit_time)=2021) t1 on exam_record.uid = t1.uid where exam_record.submit_time is not null and ...