Write a query to delete duplicate records in SQL SERVER

Answer Posted / sujit kumar suman,new delhi

DELETE DUPLICATE RECORDS FROM TABLE IN SQL SERVER:

DELETE FROM TABLE1
WHERE
ID NOT IN
(SELECT MAX(ID) FROM TABLE1
GROUP BY NAME)

WHERE ID IS IDENTITY FIELD AND NAME IS DUPLICATE FIELD

TRY THIS QUERRY AND ENJOY.......

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how many normalization forms?

581


What are the advantages of log shipping?

563


You want to implement the one-to-one relationship while designing tables. How would you do it?

534


Explain what are the restrictions while creating batches in sql server?

588


in a table is b in column k (manikanta,sivananda,muralidhar) i want result like (mnikanta,sivnanda,murlidhar) please slove it

1056






what are the reporting service components in SSRS?

118


What are the dmvs?

573


What is the security principal at the server level that represents your session?

558


Which is the latest version of sql server and when it is released?

549


How to provide values to user defined function parameters?

557


What is exporting utility?

544


What are the properties of sub-query?

585


What is inline table-value user-defined function?

596


Describe how to use linked server?

547


What are the different types of collation sensitivity?

556