Mysql
 sql >> Datenbank >  >> RDS >> Mysql

SQL - Wählen Sie 'n' größte Elemente in der Gruppe aus

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