题解 | #每类视频近一个月的转发量/率#
每类视频近一个月的转发量/率
http://www.nowcoder.com/practice/a78cf92c11e0421abf93762d25c3bfad
SELECT tag, sum(if_retweet) as retweet_cnt, round(sum(if_retweet)/count(if_retweet),3) as retweet_rate from tb_user_video_log uv join tb_video_info v using(video_id) where date(start_time)>= (SELECT date(date_add(max(end_time),interval -29 DAY)) as max_day from tb_user_video_log) group by tag order by retweet_rate desc