Skip to content
Advertisement

how to select max score from duplicate mobile_number

enter image description here

how can I filter record 60122839991 with the highest score 95.3758 and return as below without duplicate phone number

enter image description here

Advertisement

Answer

Use distinct on:

select distinct on (mobile_number) t.*
from mytable t
order by mobile_number, score desc
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement