Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mukarramjavid/b903216e638b273d3e1ed5e3d219829d to your computer and use it in GitHub Desktop.
Save mukarramjavid/b903216e638b273d3e1ed5e3d219829d to your computer and use it in GitHub Desktop.
Find Duplicates using CTE in SQL Server
;WITH CTE_RugbyLeague AS(
SELECT ProviderMatchId,TeamId,PlayerId ,ROW_NUMBER() OVER (PARTITION BY ProviderMatchId,TeamId,PlayerId ORDER BY ProviderMatchId DESC) AS ROW_NO
FROM CTE_RugbyLeague WITH(NOLOCK)
)
SELECT *
FROM CTE_RugbyLeague
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment