select * from users as t1
where (select count(*) from users as t2
where t1.division = t2.division and t2.rank > t1.rank) <2
order by division,rank
select * from users as t1
where (select count(*) from users as t2
where t1.division = t2.division and t2.rank > t1.rank) <2
order by division,rank