select exam_id, date_format(start_time,"%Y%m") as month, count(id), sum(count(id))over(partition by exam_id order by date_format(start_time,"%Y%m") ) from exam_record group by exam_id,month
select exam_id, date_format(start_time,"%Y%m") as month, count(id), sum(count(id))over(partition by exam_id order by date_format(start_time,"%Y%m") ) from exam_record group by exam_id,month