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 / nagabhushan adhikari

These are duplicates....

select distinct(col1),col2,col3.... into #temp from table
group by col1 having count(1) > 1

by the below delete duplicates
delete table from table A, #temp B where A.col1= B.col1

by this insert only a single record
insert into table select col1, col2,col3... from #temp

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the meaning of sql server?

985


What is a table called, if it has neither cluster nor non-cluster index? What is it used for?

1022


What the class forname () does?

1051


Explain the microsoft sql server delete command?

1014


What are data resources?

904


What structure can you implement for the database to speed up table reads?

1191


How is sql used in sql server?

999


What is normalization? Describe its different types.

1097


Explain about merge replications?

1010


How do I start sql server?

964


How much does sql server 2016 cost?

1052


What do you mean by an execution plan? Why is it used? How would you view it?

923


What is it unwise to create wide clustered index keys?

1005


What are cascading parameters in ssrs reports?

229


Tell me what are the advantages of using stored procedures?

1000