Home Forums SQL Server 2008 T-SQL (SS2K8) Delete Duplicate Records, RE: Delete Duplicate Records,
ColdCoffee
SSC-Dedicated
Points: 39971
More actions
May 7, 2010 at 6:56 am
#1164045
This will get you there!
;WITH CTE AS
(
SELECT ROW_NUMBER() OVER(PARTITION BY SIZE ORDER BY ID) RN , ID, SIZE FROM @table
)
DELETE FROM CTE WHERE RN <> 1
Hope this helps!
Cheers!