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

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

https://www.nowcoder.com/practice/8e33da493a704d3da15432e4a0b61bb3

select
    date_format (in_time, '%Y-%m-%d'),
    round(sum(timestampdiff (second, in_time, out_time))/count(distinct uid),1) avgtime
from
    tb_user_log
where
    in_time like '2021-11%' and artical_id like '900_'
group by  date_format (in_time, '%Y-%m-%d')
order by avgtime

本题难度不大,因为还要注意客户浏览的未必全部都是文章,需要对于文章这块的内容like'9000_'做限制

全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务