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 is a partition function in sql server?

1216


Explain what are magic tables in sql server?

1046


what is datawarehouse?

1157


How do you drop an index?

973


What is user-defined multi-statement table-valued function?

1120


How to create a view using data from another view?

994


How many columns can exist together per table?

1207


Explain sql server service broker?

1026


Which table keeps information about stored procedures?

983


What is the difference between MVC and Teir Architecher? Plz explain with Layyered Programming example...? Thanks

2136


What do you need to connect php to sql server?

1153


What is cursors?

1260


What is difference between clustered and non clustered index?

1034


What is key set driven?

1009


What are the two modes of authentication in sql server?

1136