With TestData as
(
Select
EmployeeId,
Row_Number() Over( Partition By EmployeeName Order By EmployeeName) AS Rowid
From
Employees
)
Select EmployeeId from TestData Where RowId > 1
If we need to get the duplicate records by two columns, those two columns should be in the Partition By column, and in the order by column.
No comments:
Post a Comment