Hi @kkran ,
According to your requirement, you could try with max(lastupdatedt ) ... group by... as below:
Select oldID,newid,oldname,newname,oldstreet,newstreet
,max(lastupdatedt) lastupdatedt
from TableK
group by oldID,newid,oldname,newname,oldstreet,newstreet
Output :
oldID newid oldname newname oldstreet newstreet lastupdatedt
1619 1619 Zia Broadst lombardst 2021-02-11 14:57:00.000
1619 1619 Ava Zia Broadst lombardst 2021-02-12 13:57:00.000
1619 1619 Eva Zia Broadst lombardst 2021-02-10 14:57:00.000
If above query is not working, please provide more sample data and expected output.
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.