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 get Report Builder to generate a parameter that can be set by users viewing the report?

154


How do database indexes work?

1019


What is store procedure?

1071


Do you know what is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure?

1004


What are the advantages of user-defined functions over stored procedures in sql server?

1052


What is a dataset and what are the different types of datasets?

136


Tell about MOM Tool(Microsoft Operator Manager)?

1920


How to run sql server 2005 books online on your local system?

963


What is the current pricing model of SQL Azure?

104


Data table as parameter in sql server?

1057


Why it is recommended to avoid referencing a floating point column in the where clause?

974


Which language rdl files made of?

133


What is user-defined inline table-valued function?

966


What are the steps to process a single select statement?

951


Explain cursor as data base object?

1048