Write a query to delete duplicate records in SQL SERVER

Answer Posted / prakash patel

delete from tbl_test where ID in
(select ID from tbl_test group by ID having count(ID) > 1)

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Mention the differences between having and where clause.

559


Difference between 2NF &3NF ?

683


Is null vs coalesce?

509


Explain nested stored procedure. Syntax and an example for create nested stored procedure?

534


What command would you use to add a column to a table in sql server?

754






What is encryption key?

84


What Are the Main Features of SQL Azure?

95


How to provide values to user defined function parameters?

557


When you should use a low fill factor?

527


What is save transaction and save point?

630


What are cursors and when they are useful?

577


How can sql server instances be hidden? : sql server security

599


What is scd (slowly changing dimension)? : sql server analysis services, ssas

598


What is database replication? What are the different types of replication you can set up in sql server?

502


What is the status of services on passive node for failover cluster in sql server? : sql server database administration

639