select
author,
date_format(start_time,'%Y-%m')month,
round(sum(if(if_follow=2,-1,if_follow)) / count(*),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 a
left join tb_video_info b
on a.video_id=b.video_id
WHERE YEAR(start_time)=2021
group by author,month
order by author,total_fans