Write a query to delete duplicate records in SQL SERVER
Answer Posted / anuj dhingra
DELETE
FROM MyTable
WHERE ID NOT IN
(
SELECT MAX(ID)
FROM MyTable
GROUP BY DuplicateColumn1, DuplicateColumn2,
DuplicateColumn2)
Is This Answer Correct ? | 12 Yes | 8 No |
Post New Answer View All Answers
What is the difference between primary key and unique constraints?
What are commit and rollback in sql?
What is update locks?
How can you append an identity column to a temporary table?
What is the size of transaction log file?
Explain few of the new features of sql server 2008 management studio
What is the difference between seek predicate and predicate?
What do you mean by the term 'normalization'?
What are subquery and its properties?
What is multilevel indexing?
How to get a list of columns using the "sys.columns" view in ms sql server?
What are information schema views?
Explain cdc and sql injection?
When to use null data driven subscription?
Can we use trigger new in before insert?