Write a query to delete duplicate records in SQL SERVER

Answer Posted / saurabh dixit

DECLARE @people TABLE
(
name VARCHAR(32),
age INT
)
insert into @people
select Name,age From People group by Name,Age having COUNT(name)>1

delete People from People pe
join @people p on pe.name=p.name and pe.age=p.age

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you understand by recursive stored procedures?

575


What is normalization 1nf 2nf 3nf?

641


How to create a login account in ms sql server to access the database engine using "create login" statements?

580


What is a performance monitor?

564


Explain filtered indexes benefits?

610






Should you normalize audio?

536


What is a hint?

589


What are the types of subquery?

557


Explain the types of indexes.

651


How many triggers are possible per table?

635


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

583


What is the purpose of indexing?

606


How we create SQL Server 2005 Reporting Services ? Give me Sample

1581


what is bit datatype? : Sql server database administration

514


Write a SQL queries on Self Join and Inner Join.

623