Ver Mensaje Individual
  #10 (permalink)  
Antiguo 14/10/2005, 09:54
Avatar de Jose_minglein2
Jose_minglein2
 
Fecha de Ingreso: noviembre-2004
Mensajes: 2.344
Antigüedad: 19 años, 5 meses
Puntos: 8
Perdón llevás de nuevo razón, el offset es a 4 no a 5, ya que el primero es 0 no 1, quedaría:

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 offset 4)
)
Pero siempre con la limitación que te comento.