Write a query to delete duplicate records in SQL SERVER

Answer Posted / chandran.s

Table Name: Example

Name Age
chandran 23
ranjith 24
chandran 23

To delete one of the duplicate records use following query


delete from example where age in(select age from example
group by age having count>1)

Is This Answer Correct ?    13 Yes 46 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why are sql functions used?

622


What is the data type of time?

520


What is the use of sql profiler in sql server 2012?

513


What is the log shipping?

587


What are filegroups in sql server?

582






What is “asynchronous” communication in sql server service broker?

546


mention different types of relationships in the dbms?

507


What is for xml in sql server?

540


How to write the storeprocedure with in the store procedure? and how can we write the store procedure with in a trigger vice versa? plz post me the exact answer?

2119


What is resultset concur_updatable?

585


How optimize sql query with multiple joins in sql server?

417


What do you understand by coalesce in sql server?

499


what are user defined datatypes and when you should go for them? : Sql server database administration

544


What is ms sql server triggers?

538


How many columns can we include on clustered index ?

511