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
What is dml command?
Explain the difference between delete,drop and truncate in SQL Server?
List the data types available in mssql?
How to verify a login name with sqlcmd tool?
What are “lost updates”?
How to view existing indexes on an given table using sys.indexes?
Data table as parameter in sql server?
How ssrs maintain security?
When cursors are useful?
How to stop a loop early with break statements in ms sql server?
How do you run a trace?
How do I completely remove sql server instance?
what is the difference between count(*) and count(1) ?
List some case manipulation functions in sql?
What is the optimal disk configuration for a database server and what raid configurations would you use if budget is not a constraint?