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 happens if date-only values are provided as date and time literals?

975


What is the sql server 2000 version number?

1007


Explain ranking functions?

991


What is SQL Azure?

105


Write a Select Query to display title for each group of records, which are collected with Compute Clause? Like titlefield column-A column-B ..... ..... ..... Sum ... titlefield column-A column-B ..... ..... ..... Sum ...

1987


How to use go command in "sqlcmd"?

1125


What are the different types of collation sensitivity?

1055


Explain DBCC?

908


Explain how you can deploy an SSRS report?

137


What is a collation in ms sql server?

1016


How to delete existing rows in a table?

1071


as a general practice, it is recommended to have dbo be the owner of all database objects however, in your database you find number of tables owned by a user other than dbo, how could you fix this? : Sql server administration

913


Do you know what are the restrictions that views have to follow?

1015


Write a SQL query to make a column as unique?

960


How to encrypt data between dialogs?

1031