sql >> Base de Datos >  >> RDS >> Mysql

Selección de múltiples filas máximas

select
  x.Domain,
  x.No_of_users
from
  (select
    d.Domain, 
    count(d.Domain) as No_of_users
  from
    Domain d
  group by 
    d.Domain) x
where
  x.No_of_users = 
    (select
      max(x2.No_of_users)
    from
      (select
         d2.Domain,
         count(d2.Domain) as No_of_users
      from
         Domain d2
      group by 
        d2.Domain) x2)