Saturday, February 1, 2014

get unique sort result ids

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