Oracle
 sql >> Database >  >> RDS >> Oracle

Ottieni record in base al valore massimo della colonna

prova

    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