select
ab.course_id,
ct.course_name,
count(ab.user_id) online_num
from
attend_tb ab inner join course_tb ct on ab.course_id = ct.course_id
where date_format(in_datetime, "%T") <= "19:00:00"
group by course_id,course_name
order by course_id
select
ab.course_id,
ct.course_name,
count(ab.user_id) online_num
from
attend_tb ab inner join course_tb ct on ab.course_id = ct.course_id
where date_format(in_datetime, "%T") <= "19:00:00"
group by course_id,course_name
order by course_id