Mysql
 sql >> Database >  >> RDS >> Mysql

L'alternativa di MySQL a WITH TIES di T-SQL

Questo funziona per te?

select Name, Value from table where Value in (
    select distinct Value from table order by Value desc limit 3
) order by Value desc

O forse:

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