Mysql
 sql >> Base de données >  >> RDS >> Mysql

L'alternative de MySQL à WITH TIES de T-SQL

Cela vous convient-il ?

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

Ou peut-être :

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