T-SQL statement to delete duplicate rows from a table with an identtity column. When several records have equal data in other columns and only one record should be kept.
DELETE FROM dbo.TableA
WHERE Id NOT IN
(
SELECT MIN(Id)
FROM dbo.TableA
GROUP BY Column1, Column2 -- combination of columns that gives duplicates
)
2 comments:
Want to Display unique records from view
I m using visual studio light switch 2013
Post a Comment