题解 | 短视频直播间晚上11-12点之间各直播间的在线人数

短视频直播间晚上11-12点之间各直播间的在线人数

https://www.nowcoder.com/practice/38f5febc9dac4e9e84ed5891a3e4ca05


select t1.room_id,room_name,count( distinct user_id) as user_count
from (
        select user_id,room_info_tb.room_id,room_name
        from user_view_tb join room_info_tb on user_view_tb.room_id=room_info_tb.room_id
        where time (out_time)>='23:00:00' and time (in_time)<='23:59:59'
     ) as t1

group by room_name, t1.room_id
order by  user_count desc ,room_id

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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