select t1.name,t1.cnt
from
(
select b.name,a.subject_id,count(a.subject_id) cnt
from submission a left join subject b
on a.subject_id=b.id
where a.create_time=current_date
group by b.name,a.subject_id
order by cnt desc,a.subject_id asc
) t1;

京公网安备 11010502036488号