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

What are the types of table?

974


What are the purposes and advantages stored procedure?

945


What do you understand by mirroring and mention the advantages of the mirroring?

1052


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?

969


Explain data warehousing in sql server?

1030


How to include text values in sql statements?

1025


How to get nth highest salary from employee table.

1156


What is the purpose of sql profiler in sql server? : sql server database administration

1096


What is repeatable read?

1003


What are cascading parameters in ssrs reports?

229


What is difference between clustered index and non clustered index?

1067


What is difference between unique and primary key?

896


What are two difference between sql azure and azure tables?

159


What is database dimension? : sql server analysis services, ssas

1069


What is a non equi join?

971