WITH t1 AS( SELECT t1.video_id, SUM(if_like) AS like_cnt, SUM(IF(comment_id IS NULL, 0, 1)) AS comment_cnt, SUM(if_retweet) AS retweet_cnt, AVG(IF(TIMESTAMPDIFF(second, start_time, end_time) >= duration, 1, 0)) AS finish_rate, 1 / (DATEDIFF((S...