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

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

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

select
    date(out_time),
    round(
      sum(timestampdiff(second,in_time,out_time)) 
      / count(distinct uid),1) time
from
    tb_user_log
where
    artical_id not in (0)
    and month(out_time) = '11'
group by
    date(out_time)
order by
    time 

简单题要什么题解? 为什么题上说2021-11 我却只整了一个11?,当然是我猜到他没有限制年份,不过要写的话也很简单或者加一个and 或者改一下month函数

一天一个Mysql 文章被收录于专栏

学习,一天一个mysql

全部评论

相关推荐

04-18 00:32
已编辑
中南大学 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务