SELECT author, date_format(start_time,'%Y-%m') month, round(sum(IF(if_follow=2,-1,if_follow))/count(author),3) fans_growth_rate, sum(sum(IF(if_follow=2,-1,if_follow))) over(partition by author order by date_format(start_time,'%Y-%m')) total_fans from tb_user_video_log t1 LEFT join tb_video_info t2 ...