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 / deepak raheja

DELETE FROM A
WHERE (id NOT IN
(SELECT MAX(ID)
FROM A
GROUP BY name))

suppose i have table called A. A has two coloumn id
(identity) as int and Name as nvarchar. I have data like
this.

id Name
1 C
2 D
3 C
4 E
5 D
6 D

Is This Answer Correct ?    78 Yes 57 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the operating modes in which database mirroring runs?

1091


What are the properties of the relational tables?

881


What is Service Broker in sql server 2012?

1025


How to use order by with union operators in ms sql server?

1025


Explain a join?

1072


What is database replication? What are the different types of replication you can set up in sql server?

964


What is Federation Root Database?

104


List the different normalization forms?

985


What is the Disadvantage of indexed sequential file.

1084


Define left outer join?

974


Explain the database you used in your final year project?

1047


What should be the fill factor for indexes created on tables? : sql server database administration

1143


What is multilevel indexing?

934


Explain what are the different index configurations a table can have?

1116


What are the different types of upgrades that can be performed in sql server?

1177