Tengo una solución para ti, pero hay un pequeño problema, bueno primero el codigo:
Código:
(SELECT country, COUNT(*) AS total FROM provider_id GROUP by country ORDER BY total DESC Limit 5 )
union
(
select 'otros' as country, count(*) as total from provider_id PI where
(select count(*) from provider_id where country=PI.country)<
(select count(*) as total from provider_id group by country order by total desc limit 1)
)
Pero con esta hay un pequeñísimo problema y es que si por ejemplo, la posicion nº 6 y la nº 5 tienen el mismo count sólo aparecerá hasta la 5 (eso bien) pero en otros la posicion nº 6 no será contada.
Pero sigo investigando.