题解 | #每类视频近一个月的转发量/率#
每类视频近一个月的转发量/率
https://www.nowcoder.com/practice/a78cf92c11e0421abf93762d25c3bfad
select tag, sum(if_retweet) as retweet_cut, round(sum(if_retweet)/count(start_time),3) as retweet_rate from tb_user_video_log as a left join tb_video_info as b on a.video_id=b.video_id where timestampdiff(day,start_time,(select max(start_time) from tb_user_video_log))<=29 group by tag order by retweet_rate desc;