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
How to add additional conditions in SQL?
What is index fragmentation in ms sql server?
Explain how you can deploy an SSRS report?
What is a functions and types in sql server?
How to create a scrollable cursor with the scroll option?
What is the syntax for encrypting a column in SQL Server?
How to create an index on an existing table in ms sql server?
What are the types of indexing?
Do you know what is normalization of database? What are its benefits?
How to find related tables in sql server?
Is it possible to replicate data from sql server to oracle? : sql server replication
How to create view in stored procedure sql server?
In which sql server version report builder introduced?
if no size is defined while creating the database, what size will the database have? : Sql server administration
Explain alternate key, candidate key and composite key in sql server?