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

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

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

select author
,date_format(start_time,'%Y-%m') month
,round(sum(case when if_follow=1 then 1
             when if_follow=2 then -1
             else 0 end)/count(author),3)
,sum(sum(case when if_follow=1 then 1
             when if_follow=2 then -1
             else 0 end))over(partition by author order by date_format(start_time,'%Y-%m'))as z
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,z

全部评论

相关推荐

点赞 评论 收藏
分享
用户64975461947315:这不很正常吗,2个月开实习证明,这个薪资也还算合理,深圳Java好多150不包吃不包住呢,而且也提前和你说了没有转正机会,现在贼多牛马公司骗你说毕业转正,你辛辛苦苦干了半年拿到毕业证,后面和你说没hc了😂
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务