select tag, concat( round( AVG(case when TIMESTAMPDIFF(second ,start_time,end_time)>=i.duration then 1 else TIMESTAMPDIFF(second ,start_time,end_time)/duration end )*100,2 ),'%') as avg_video_timepercent from tb_user_video_log as l left join tb_video_info as ...