select t.tag, concat(round(avg(if(t.duration < t.difftime, 1, t.difftime/t.duration)*100),2),'%') avg_play_progress from( select user.uid, user.video_id, user.start_time, user.end_time, video.duration, timestampdiff(second, user.start_time, user.end_time) difftime, video.tag from ...