+ 3
Remove duplicate rows in SQL
how to remove/delete the duplicate rows in a table using SQL.
3 Answers
+ 2
Use DISTINCT keyword for this
+ 1
https://stackoverflow.com/questions/18932/how-can-i-remove-duplicate-rows
DELETE FROM MyTable
LEFT OUTER JOIN (
SELECT MIN(RowId) as RowId, Col1, Col2, Col3
FROM MyTable
GROUP BY Col1, Col2, Col3
) as KeepRows ON
MyTable.RowId = KeepRows.RowId
WHERE
KeepRows.RowId IS NULL
0
what if we have to delete the row permanently from database