题解 | #每个创作者每月的涨粉率及截止当前的总粉丝量#

每个创作者每月的涨粉率及截止当前的总粉丝量

http://www.nowcoder.com/practice/d337c95650f640cca29c85201aecff84

select author,month,fans_growth_rate,
sum(follow) over(partition by author order by month) as total_fans from(
select author,left(start_time,7) month,round(sum(
case when if_follow=2 then -1 else if_follow end)/count(*),3) as fans_growth_rate,
sum(case when if_follow=2 then -1 else if_follow end) as follow
from tb_user_video_log t1,tb_video_info t2
where t1.video_id=t2.video_id and year(start_time)=2021
group by t2.author,month
)a order by a.author,total_fans
全部评论

相关推荐

牛马人的牛马人生:一开始看成了网吧
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务