select date(out_time) as dt,round(sum(TIMESTAMPDIFF(second,in_time,out_time))/count(distinct uid),1) as avg_view_len_sec
from tb_user_log 
where artical_id <>0 and DATE_FORMAT(out_time,"%Y%m")=202111
group by dt
order by avg_view_len_sec