Skip to content
Advertisement

Need to select 2 most recent dates for 2 id’s

I need to return 2 most recent dates for each client id, i have 12345 and 112233 and for each of them i need to create a function which supposed to return to me this

Supposed to return this

Advertisement

Answer

The best way in Postgres is distinct on:

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