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...

if 3 duplicate records in a table,i want to delete 2 duplicate
records by keeping 1 duplicate and 1 original as it is,how?

Answer Posted / dhananjay

The simplest way to eliminate the duplicate records is to
SELECT DISTINCT into a temporary table, truncate the
original table and SELECT the records back into the original
table. That query looks like this:

select distinct *
into #holding
from dup_authors

truncate table dup_authors

insert dup_authors
select *
from #holding

drop table #holding

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to make a column nullable?

1122


What is the security model used in sql server 2005?

1011


Write a SQL query to delete a table?

1142


Can select statements be used on views in ms sql server?

1065


What is difference between Datepart() and Datename() in SqlServer?

1209


how many triggers you can have on a table? : Sql server database administration

978


What is a cache in ssrs?

134


When is update_statistics command used?

1052


where can you add custom error messages to sql server? : Sql server administration

1123


How to trouble shoot if unable to connect SQL Server

1993


What do you understand by the denormalisation?

962


can you instantiate a com object by using t-sql? : Sql server database administration

1004


How to loop through result set objects using mssql_fetch_array()?

1084


as a part of your job, what are the dbcc commands that you commonly use for database maintenance? : Sql server database administration

909


Where to find ntwdblib.dll version 2000.80.194.0?

962