select i.tag, sum(l.if_retweet) retweet_cut, round(sum(l.if_retweet)/count(i.tag),3) retweet_rate
from tb_user_video_log l left join tb_video_info i on l.video_id = i.video_id 
where DATEDIFF(DATE((select max(start_time) FROM tb_user_video_log)), DATE(l.start_time)) <= 29
group by i.tag order by retweet_rate desc