sql >> Base de Datos >  >> RDS >> Oracle

Obtenga registros basados ​​en el valor máximo de la columna

prueba

    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