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 do I schedule a sql server profiler trace?
What is tabulation?
How much is a sql server license?
Where are stored procedures in sql server?
why would you call update statistics? : Sql server database administration
Can You Use A Stored Procedure To Provide Data To An Ssrs Report?
What is read committed?
What is the purpose of grouping data in a report?
How to connect Azure federated root database and apply federation in entity framework?
How to retrieve error messages using odbc_errormsg()?
How to Check if table exists in sql server?
How do I port a number to sql server?
Difference between aggregate functions of sql?
how can you attach more than 20 ldf files in sql server
How can change procedure in sql server?