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
Explain the purpose of indexes?
What are page splits?
Explain the working of sql privileges?
How to delete database objects with "drop" statements in ms sql server?
What are filegroups in sql server?
What is the difference between a clustered index and a non-clustered index?
How to make a column nullable?
explain what is raid and what are different types of raid configurations? : Sql server database administration
Where views are stored in sql server?
What is the partitioning method?
How to convert numeric expression data types using the cast() function?
What is difference between rownum and rowid?
What do we need queues in sql service broker?
what is create database syntax? : Sql server database administration
Explain subquery and state its properties?