Skip to content

Instantly share code, notes, and snippets.

@gsampath127
Last active October 11, 2019 18:35
Show Gist options
  • Save gsampath127/1caee384199232df7306a60b93d9d79e to your computer and use it in GitHub Desktop.
Save gsampath127/1caee384199232df7306a60b93d9d79e to your computer and use it in GitHub Desktop.
WITH Result As
(
SELECT *, ROW_NUMBER() OVER(PARTITION BY [FirstName] ORDER BY [FirstName] )
as RowNum FROM [dbo].[Employees]
)
SELECT * FROM RESULT where RowNum > 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment