1WITH cte AS (
2 SELECT
3 contact_id,
4 first_name,
5 last_name,
6 email,
7 ROW_NUMBER() OVER (
8 PARTITION BY
9 first_name,
10 last_name,
11 email
12 ORDER BY
13 first_name,
14 last_name,
15 email
16 ) row_num
17 FROM
18 sales.contacts
19)
20DELETE FROM cte
21WHERE row_num > 1;
22
1WITH CTE AS(
2 SELECT [col1], [col2], [col3], [col4], [col5], [col6], [col7],
3 RN = ROW_NUMBER()OVER(PARTITION BY col1 ORDER BY col1)
4 FROM dbo.Table1
5)
6DELETE FROM CTE WHERE RN > 1
7