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

Can you import Microsoft Excel data to SSRS?

124


what is denormalization? : Sql server database administration

877


What is the process of normalization?

1054


Explain how to integrate the ssrs reports in application?

943


What do you mean by SQL injection attack?

1006


What is difference between delete and truncate commands?

995


What is the contrast between sql and mysql?

1049


query processing

2102


What is the tcp/ip port on which sql server runs?

1060


How to list all columns in a table using odbc_columns()?

935


What is the use of toad or sqldbx.?

1099


How would you choose between a clustered and a non-clustered index?

917


What does executeupdate return?

927


How can windows applications connect to sql servers via odbc?

1060


What are distributed partitioned views?

1006