# 先筛选出2021年11月的数据,然后按日期分组,再计算人均浏览时长
select date(in_time), 
round(sum(timestampdiff(second, in_time, out_time))/count(distinct uid),1) avg_viiew_len_sec
from tb_user_log
where artical_id <> 0
and date_format(in_time, '%Y%m') = '202111'
group by date(in_time)
order by avg_viiew_len_sec;