How to remove duplicate rows in SQL ?
Assuming no nulls, you GROUP BY the unique columns, and SELECT the MIN (or MAX) RowId as the row to keep. Then, just delete everything that didn’t have a row id:
LEFT OUTER JOIN (
SELECT MIN(RowId) as RowId, Col1, Col2, Col3
GROUP BY Col1, Col2, Col3
) as KeepRows ON
MyTable.RowId = KeepRows.RowId
KeepRows.RowId IS NULL