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

Is it possible to have clustered index on separate drive from original table location?

1031


Does view occupy space?

1003


Can we do dml on views?

1027


What is temporary table in sql server? Why we use temp table?

1004


Where can you add custom error messages to sql server?

1193


what is spatial nonclustered index

1050


explain different types of backups avaialabe in sql server? Given a particular scenario, how would you go about choosing a backup plan? : Sql server database administration

1118


What are the pros and cons of putting a scalar function in a queries select list or in the where clause?

1284


What is the difference between for xml raw and for xml auto?

1102


Equi join and non equi join is possible with sql server?

1116


Why use identity in sql server?

1185


Why we use the openxml clause?

1059


Explain system functions or built-in functions? What are different types of system functions?

1055


How to enter binary string literals in ms sql server?

1231


What are the different subsets of sql?

1635