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 do you mean by SQL injection attack?

1067


What are the advantages of sql azure?

140


How to generate create procedure script on an existing stored procedure?

1011


Explain indexing and what are the advantages of it?

1028


What are the different Topologies in which Replication can be configured?

1185


What is triggers and stored procedures?

943


Does sql server 2016 have ssms?

962


What is a trigger and types of a trigger?

983


What the class forname () does?

1065


Explain error handling in ssis?

1025


What is the usage of sign function?

1115


Explain what role entity and relationship play in an ER diagram.

1073


Where are sql server usernames and passwords stored in the sql server?

1116


What is local temp table?

960


What is indexed view?

980