Try the below:
;With cte
as
(Select *,Row_number() over(partition by id order by SORT asc) Rn From Table)
Select * From cte
Where Rn=1
No comments:
Post a Comment