Saturday, September 27, 2014

Find the duplicate records with the help of CTE

with cte 
as
(
select *,ROW_NUMBER() over (partition by EmpName order by EmpId desc) Rn
from Employee
)
select * from cte where Rn=1

No comments:

Post a Comment