题解 | #牛客直播开始时各直播间在线人数#

牛客直播开始时各直播间在线人数

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

select t1.course_id,t2.course_name,t1.num from (
select count(distinct user_id) as num ,course_id from 
attend_tb where time(in_datetime)<='19:00:00' and time(out_datetime) >='19:00:00' 
group by course_id ) t1 
left join course_tb as t2 on t1.course_id = t2.course_id 
order by t1.course_id 

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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