[ad_1]
Assuming there are no PK/Unique constraint involving Staffid and branchid, follows:
select branchid
from table
group by branchid
order by count(staffid) desc
limit 5
Guess this will do.
2
[ad_2]
solved need help to do a mysql query [closed]