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

After creating the cube, if we added a new column to the oltp table then how you add this new attribute to the cube? : sql server analysis services, ssas

910


What is 4nf in normalization form?

969


What are different type of Collation Sensitivity?

955


explain different types of cursors? : Sql server database administration

1045


What happens if null values are involved in string operations?

936


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

998


 Explain what is sql override for a source taLle in a mapping?

960


What is the filtered index?

991


List types of tables in SQL Azure?

126


Different types of keys in SQL?

1053


How to Check if table exists in sql server?

1087


Explain the use of containers in ssis and also their types?

925


How to replace the Query Result 'Null Value' with a text ?

993


How to select some specific rows from a table in ms sql server?

971


Differentiate between a local and a global temporary table?

907