select video_id, round( count( case when F = 'Y' then 1 end ) / count(F), 3 ) R from ( select uid, lg.video_id, if(end_time - start_time >= duration, 'Y', 'N') F from tb_user_video_log lg left join ( selec...