题解 | 2021年11月每天的人均浏览文章时长

SELECT DATE(in_time) AS dt, 
ROUND(SUM(TIMESTAMPDIFF(second, in_time, out_time)) / COUNT(DISTINCT uid), 1) AS avg_viiew_len_sec
FROM tb_user_log 
WHERE artical_id != 0 AND YEAR(in_time) = 2021 AND MONTH(in_time) = 11
GROUP BY DATE(in_time)
ORDER BY avg_viiew_len_sec;

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务