Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

Alternativa do MySQL para T-SQL's WITH TIES


Isso funciona para você?
select Name, Value from table where Value in (
    select distinct Value from table order by Value desc limit 3
) order by Value desc

Ou talvez:
select a.Name, a.Value 
from table a
join (select distinct Value from table order by Value desc limit 3) b
     on a.Value = b.Value