duplicate records
how to eliminate duplicate records in sql server?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Suthish NairPosted Mar 7, 2011, 2:20 PM
Lalit MPosted Mar 4, 2011, 5:13 AM
DELETE
FROM MyTable
WHERE ID NOT IN
(
SELECT MAX(ID)
FROM MyTable
GROUP BY DuplicateColumn1, DuplicateColumn2, DuplicateColumn3)
OR
SELECT DISTINCT * INTO DuplicateTb FROM dublicatetest GROUP BY sname,rno HAVING COUNT(rno) > 1
will get more details below link
http://www.kodyaz.com/articles/delete-duplicate-records-rows-in-a-table.aspx
Soft CornerPosted Mar 4, 2011, 5:07 AM
Delete all the duplicates using CTE (Common table expression) and ROW_NUMBER(), which is a new in SQL server 2005 and above.
Refer this Article : - Remove Duplicate Records