Delete Duplicate Records from the ResultSet

You are here:
← All Topics

WITH CTE AS
(
SELECT ResultTypeID, Info1, Info2, Info3, Info4,
RN = ROW_NUMBER() OVER(PARTITION BY ResultTypeID, Info1, Info2, Info3, Info4 ORDER BY MatchPercentage DESC)
FROM #tmpSearchResults
)
DELETE FROM CTE WHERE RN > 1

Note: In the Partition By section write the name of the Column or Columns you want to have unique.

Previous Create Temporary Table
Next Reseed Table Primary Column
Table of Contents