Skip to content
Advertisement

Oracle PLSQL – Selecting Row with Max Value

I have rows like this:

If I want to get the result like below

Which is based on grouping by column 1 and choose the rows with max value in column 4 independent of other columns (2 & 3).

Instead of creating subquery, is there a way to do this?

Advertisement

Answer

Without using subquery, you can use keep dense_rank function (its aggregate version) like below :

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement