-- 这题还挺简单 -- 1、用group by求解每月作答数,用作临时表t # select # exam_id, # replace(date_format(start_time,"%Y-%m"),'-','') # as start_month, # count(start_time) as month_cnt # from exam_record # group by start_month, exam_id -- 2、用窗口函数求取截至当月作答数 select exam_id, start_month, ...