``` select live_id, max(user_count) max_user_count from ( select user_id, live_id, sum(user_change) over(partition by live_id order by event_time) user_count from ( select user_id, live_id, in_datetime event_time, 1 user_change from live_events union all select user_id, live_id, out_datetime, -1 from live_events )t1 )t2 group by live_id; 同时最大人数问题,打标签+1,-1然后union聚合,结束
16 1

相关推荐

程序员花海:实习和校招简历正确格式应该是教育背景+实习+项目经历+个人评价 其中项目经历注意要体现业务 实习经历里面的业务更是要自圆其说 简历模板尽可能保持干净整洁 不要太花哨的
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务