Hi @kkran ,
Please refer below:
;with cte as (
select FirstName,LastName,id,date,let1,let2,documents
,ROW_NUMBER() over (partition by FirstName,LastName,id,date,let1,let2 order by documents desc) rn
from TableK )
select FirstName,LastName,id,date,let1,let2,documents
from cte where rn=1
Output:
FirstName LastName id date let1 let2 documents
Ava Tom 1619 2021-02-10 NULL NULL Income, Insurance
baby shark 5086 2021-01-07 NULL NULL
Don Joe 736 2021-01-07 NULL NULL Income
Best regards
Melissa
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.