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 is a partition function in sql server?
Explain what are magic tables in sql server?
what is datawarehouse?
How do you drop an index?
What is user-defined multi-statement table-valued function?
How to create a view using data from another view?
How many columns can exist together per table?
Explain sql server service broker?
Which table keeps information about stored procedures?
What is the difference between MVC and Teir Architecher? Plz explain with Layyered Programming example...? Thanks
What do you need to connect php to sql server?
What is cursors?
What is difference between clustered and non clustered index?
What is key set driven?
What are the two modes of authentication in sql server?