Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Explain the purpose of indexes?

902


What are page splits?

958


Explain the working of sql privileges?

1041


How to delete database objects with "drop" statements in ms sql server?

1035


What are filegroups in sql server?

1014


What is the difference between a clustered index and a non-clustered index?

925


How to make a column nullable?

1044


explain what is raid and what are different types of raid configurations? : Sql server database administration

951


Where views are stored in sql server?

926


What is the partitioning method?

975


How to convert numeric expression data types using the cast() function?

1005


What is difference between rownum and rowid?

857


What do we need queues in sql service broker?

1005


what is create database syntax? : Sql server database administration

1055


Explain subquery and state its properties?

970