select c.video_id, round( (100*c.play_rate+5*c.like_num+3*c.comment_num+2*c.retweet_num)* (1/(datediff((select max(left(end_time,10)) from tb_user_video_log),c.max_playdate)+1)) ,0) hot_index from ( select a.video_id, sum(if_like) as like_num, sum(if_retweet) as retweet_num, ...