WITH q AS ( SELECT *,ROW_NUMBER() OVER (PARTITION BY dup_column ORDER BY dup_column) AS rn FROM mytable ) DELETE FROM q WHERE rn > 1