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 is key set driven?

947


What is the meaning of lock escalation and why/how to stop this? : sql server database administration

1029


What is sql language?

1126


Explain the collation?

1101


How to fetch the next row from a cursor with a "fetch" statement?

1066


How do I start sql server 2016?

896


How many databases can we create in a single server?

207


What are the different types of columns types constraints in the sql server?

1076


what is database replicaion? What are the different types of replication you can set up in sql server? : Sql server database administration

971


What is sharding?

116


what is the sql equivaent of the dataset relation object ?

2015


What are clustered and non-clustered index?

998


Tell me what do we need queues in sql service broker?

982


Explain transaction server isolation?

1019


Do you know what is difference between index seek vs. Index scan?

946