with k as(select a.video_id video_id,timestampdiff(second,start_time,end_time) c,duration,(timestampdiff(second,start_time,end_time))-duration d from tb_user_video_log a join tb_video_info b on a.video_id=b.video_id where date_format(start_time,'%Y')=2021 and date_format(end_time,'%Y')=2021) select ...