select l.video_id, round(avg(if(timestampdiff(second,l.start_time,l.end_time)>=i.duration,1,0)),3) as avg_comp_play_rate # ROUND(AVG(IF( # TIMESTAMPDIFF(SECOND, start_time, end_time)>=duration, 1, 0 # # )), 3) as avg_comp_play_rate from tb_user_video_log as l inner joi...