题解 | 国庆期间每类视频点赞量和转发量

select * 
from
    (select tag, date(start_time) dt,
    sum(sum(if_like)) over(partition by tag order by date(start_time) rows 6 preceding) sum_like_cnt_7d,
    max(sum(if_retweet)) over(partition by tag order by date(start_time) rows 6 preceding) max_retweet_cnt_7d
    from tb_user_video_log tuvl, tb_video_info tvi
    where tuvl.video_id = tvi.video_id
    group by tag, dt) t
where dt between '2021-10-01' and '2021-10-03'
order by tag desc, dt

太难了...

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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