使用CET和row_number()删除重复记录
WITH CTE (COl1,Col2, DuplicateCount) AS ( SELECT COl1,Col2, ROW_NUMBER() OVER(PARTITION BY COl1,Col2 ORDER BY Col1) AS DuplicateCount FROM DuplicateRcordTable ) DELETE FROM CTE WHERE DuplicateCount > 1 GO
本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 陈大雷的 Blog