select day, round(sum(second_sum)/count(uid),1) time_avg from (select substr(in_time,1,10) day, uid, sum(timestampdiff(second,in_time,out_time)) second_sum from tb_user_log where substr(in_time,1,10) >='2021-11-01' and artical_id !=0 ...