SELECT tag, SUM(if_retweet) AS retweet_cnt,ROUND(SUM(if_retweet)/COUNT(*),3) AS retweet_rate FROM tb_user_video_log t1 INNER JOIN tb_video_info t2 USING(video_id) WHERE DATEDIFF((SELECT MAX(start_time) FROM tb_user_video_log),start_time) <= 29 GROUP BY tag ORDER BY retweet_rate DESC; 根据题意先找到对应的表格...