Oracle
 sql >> Base de Dados >  >> RDS >> Oracle

Obter registros com base no valor máximo da coluna


tentar
    select cars.* FROM cars
    INNER JOIN (
        select country, max(price) AS maxprice from cars 
        GROUP BY country
    ) m
    ON cars.country = m.country AND cars.price = m.maxprice