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

Explain nested join?

1030


whats the maximum size of view state??

2248


How we can refresh the view?

1157


What is use of except clause?

1138


How to create an index on an existing table in ms sql server?

1024


What are the differences between user defined functions and stored procedures?

1127


What are the advantages of using a stored procedure?

1052


Once setting replication, can you have distributor on sql server 2005, publisher of sql server 2008?

1004


What is tempdb in sql server?

1026


Why we need sql server?

1008


How many database files are there in sql server 2000?what are they?

1103


I create a separate index on each column of a table. What are the advantages and disadvantages of this approach? : Sql server database administration

1131


How to declare a cursor with "declare ... Cursor" in ms sql server?

1089


Explain in brief how sql server enhances scalability of the database system?

1024


What is database dimension? : sql server analysis services, ssas

1129