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...

how to delete duplicate rows from table in sql server

Answer Posted / sanjay kumar dinda

Deletion of Rows depends upon the different condition...
Consider based on n columns the entire recordset is
treating a duplicate... We can delete the duplicate by
using following method...

Add one column and set uniue values to that column..

ALTER TABLE TABLE1 ADD ID INT IDENTITY(1,1)

COnsider T contains 40 columns and based on C1,C2,C3 we
have to find the duplicate and we have to delete the same...


Delete T1

FROM TABLE1 T1,TABLE1 T2
WHETE T1.C1=T2.C1 AND
T1.C2=T2.C2 AND
T1.C3=T2.C2
AND T1.ID>T2.ID


I think this will help....

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you understand by intent locks?

1001


What are the different types of normalization?

1156


List types of tables in SQL Azure?

126


In which files does sql server actually store data?

894


What is partition index in sql server?

1108


Explain different types of collation sensitivity?

972


Explain ms sql server reporting services vs crystal reports?

907


How to use “drop” keyword in sql server and give an example?

1122


What is the name of the Database which IBM mainframe uses?

975


Explain system scalar functions?

992


Explain datetimeoffset data type in sal server 2008?

899


What are the risks of storing a hibernate-managed object in a cache? How do you overcome the problems?

1096


Define Joins?

1019


What happens if date-only values are provided as date and time literals?

1013


What is tcl in sql server?

1112