Write a query to delete duplicate records in SQL SERVER
Answer Posted / sonia
Create table info(comp_id int identity(101,1),comp_name
varchar(50))
insert into info values('Progressive Ltd.')
insert into info values('Progressive Ltd.')
insert into info values('EliResearch')
insert into info values('Patni')
insert into info values('Accenture')
insert into info values('Accenture')
select * from info
DELETE FROM info
WHERE comp_name IN
(SELECT comp_name FROM info
GROUP BY comp_name HAVING COUNT(comp_name) > 1)
| Is This Answer Correct ? | 12 Yes | 38 No |
Post New Answer View All Answers
What are the types of table?
What are the purposes and advantages stored procedure?
What do you understand by mirroring and mention the advantages of the mirroring?
When does the auto update index statistics feature in sql server turn itself on?q) what specific conditions database should meet, before you can bulk copy data into it using bcp?
Explain data warehousing in sql server?
How to include text values in sql statements?
How to get nth highest salary from employee table.
What is the purpose of sql profiler in sql server? : sql server database administration
What is repeatable read?
What are cascading parameters in ssrs reports?
What is difference between clustered index and non clustered index?
What is difference between unique and primary key?
What are two difference between sql azure and azure tables?
What is database dimension? : sql server analysis services, ssas
What is a non equi join?