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

How do I change my passwords (database, LDAP, and so on) without causing an outage?

1014


What is triggers in ms sql server?

1048


What is 3nf normalization?

924


What is a scheduled job or what is a scheduled task?

910


What is the difference between upgrade and migration in sql server?

1021


What is the default fill factor value?

1009


Describe triggers features and limitations?

924


What are the different types of sql server replication? : sql server replication

1154


What is Service Broker in sql server 2012?

968


Find first and last day of current month in sql server

972


How to use “drop” keyword in sql server and give an example?

1088


What is a coalesce function?

1125


What is the process of normalising?

942


What is scan table/view and seek table/view when its occurs? : sql server database administration

984


What is the Disadvantage of indexed sequential file.

1026