with tmp as ( select uid, exam_id, start_time, date_format(start_time,'%Y%m') as ym, row_number() over(partition by uid order by start_time) as rank1 from exam_record) select ym, count(distinct uid) as mau, sum(if(rank1=1, 1, 0)) as month_add_uv, max(sum(if(ran...