Name id a 1 a 1 b 1 c 1 d 2 d 2 e 2
b 1 c 1 e 2
WITH dups AS ( SELECT *, ROW_NUMBER() OVER(PARTITION BY Name ORDER BY Name) AS rn FROM your_table ) DELETE FROM dups WHERE rn>1;
WITH cte_test AS ( SELECT *, ROW_NUMBER() OVER(PARTITION BY Name,ID ORDER BY Name) AS rn FROM table1 ) DELETE FROM cte_test WHERE rn>1;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)