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 retrieve duplicate rows in a table?
How to delete the duplicate entries in a table?

Answer Posted / mon

DELETE FROM MyTable
LEFT OUTER JOIN (
SELECT MIN(RowId) as RowId, Col1, Col2, Col3
FROM MyTable
GROUP BY Col1, Col2, Col3
) as KeepRows ON
MyTable.RowId = KeepRows.RowId
WHERE
KeepRows.RowId IS NULL

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are filegroups in sql server?

1012


What is the purpose of self join?

914


Explain in details security in SQL azure?

121


In which tcp/ip port does sql server run? Can it be changed?

945


What is the purpose of sql profiler in sql server?

960


what are the reporting service components in SSRS?

151


what is a schema in sql server 2005? Explain how to create a new schema in a database? : Sql server database administration

953


Can we use where clause in union?

1001


What are the different types of data sources in ssrs?

188


explain different types of constraints? : Sql server database administration

913


What is optimistic concurrency?

978


What is difference between rollback immediate and with no_wait during alter database?

1016


If you're given a raw data table, how would perform etl (extract, transform, load) with sql to obtain the data in a desired format?

916


What is inner join in sql server joins?

976


How to create an index on an existing table in ms sql server?

920