题解 | #牛客直播开始时各直播间在线人数#
牛客直播开始时各直播间在线人数
http://www.nowcoder.com/practice/bdd30e83d47043c99def6d9671bb6dbf
select t1.course_id,t2.course_name,t1.num from (select course_id,count(distinct user_id) num from attend_tb where substr(in_datetime,12,5)<='19:00' and substr(out_datetime ,12,5)>='19:00' group by course_id order by course_id)t1 left join (select * from course_tb)t2 on t1.course_id=t2.course_id