题解 | #每类视频近一个月的转发量/率#
每类视频近一个月的转发量/率
https://www.nowcoder.com/practice/a78cf92c11e0421abf93762d25c3bfad
-- 开窗判断时间会简单点。。。 select tag,sum(if_retweet),round(sum(if_retweet)/count(if_retweet),3) from tb_user_video_log left join tb_video_info using(video_id) where date(end_time)<=( select date(max(end_time)) from tb_user_video_log ) and date(end_time)>( select date(max(end_time))- interval 30 day from tb_user_video_log ) group by tag order by 3 desc