-5

I am trying to get the last ids if user_handle is distinct with only 1 SQL query. Anyone knows how to do this?. I need that the SQL returns the ids (16149,16154). Thanks a lot.

enter image description here

1 Answers1

2

How about using max()?

select max(id), user_handle
from t
group by user_handle;
Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786