Skip to content
Advertisement

Oracle SQL: how to show only one max per group

Hi everyone first thanks for your time. I have this data

Data:

Data

And I have to obtain the max values of everygroup, if there is one group that has two same max values like

Only show one of them. Like this

result

Till now I’ve tried two ways and they work only if there is not any repeated max per group.

Oracle SQL code:

Any ideas how to do it?

Advertisement

Answer

use row_number()

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