题解 | #每篇文章同一时刻最大在看人数#

每篇文章同一时刻最大在看人数

http://www.nowcoder.com/practice/fe24c93008b84e9592b35faa15755e48

select artical_id, max(num) as max_uv from ( select artical_id, sum(diff) over(partition by artical_id order by in_time,diff DESC) as num from ( select artical_id, in_time, 1 diff from tb_user_log WHERE artical_id != 0 union all select artical_id, out_time, -1 diff from tb_user_log WHERE artical_id != 0 order by 1,2 )a)b group by 1 order by 2 desc

全部评论

相关推荐

01-07 15:50
四川大学 Java
明远湖摸鱼:同年级的同学,,简历可以大一点,这个有点太密集了,实习技术可以量化的尽量量化
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务