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

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

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

笨蛋方法,要求什么就搞什么
select author,m,r fans_growth_rate,sum(s) over(partition by author order by m) total_fans
from(
select author,m,sum(if_follow) s,round(sum(if_follow)/count(*),3) r
from(
select author,date_format(start_time,'%Y-%m') m,case when if_follow=2 then -1 else if_follow end if_follow
from tb_user_video_log l
join tb_video_info i on l.video_id=i.video_id
where year(start_time)=2021
) a
group by author,m
    ) b
order by author,total_fans
    
全部评论

相关推荐

11-03 13:18
门头沟学院 Java
包行:平时怎么刷算法题的哇,字节的手撕听说都很难
字节跳动工作体验
点赞 评论 收藏
分享
11-19 18:44
已编辑
成都理工大学 Java
程序员花海:我面试过100+校招生,大厂后端面试不看ACM,竞赛经历含金量低于你有几份大厂实习 这个简历整体来看不错 可以海投
如何写一份好简历
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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