题解 | #每类视频近一个月的转发量/率#
每类视频近一个月的转发量/率
https://www.nowcoder.com/practice/a78cf92c11e0421abf93762d25c3bfad
select tag,sum(if_retweet) as retweet_cnt, round(sum(if_retweet)/count(*),3) as retweet_rate from tb_user_video_log a left join tb_video_info b on a.video_id = b.video_id where datediff(date((select max(start_time) from tb_user_video_log )),date(start_time)) < 30 group by tag order by retweet_rate desc
关键是 最大的日期和日期之前的差值小于30天,就代表视频最近一个月有交互