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


Please Help Members By Posting Answers For Below Questions

List out the differences between global and local temp tables in sql server?

569


What does it mean to normalize data?

512


What is pivot and unpivot?

638


Explain in details security in SQL azure?

97


How to view existing indexes on an given table using sys.indexes?

592






How to concatenate two strings in SQL Server.

591


What are the options which must be set to allow the usage of optimistic models?

511


Tell me in brief how sql server enhances scalability of the database system?

522


How do I find sql server instance name?

504


How to check table values in sql server?

528


Is oracle faster than sql server?

549


How can we use ConnectorJ JDBC Driver with MS SQL?

564


How to compose an inquiry to demonstrate the points of interest of an understudy from students table whose name begins with k?

662


What is surrogate key? : sql server analysis services, ssas

691


What are the key configuration files for sql server reporting services ?

120