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

What do you understand by a view? What does the with check option clause for a view do?

983


How to create a view using data from another view?

938


How can we call UDF(User Define Function) using C# code in ASP.net ?

6861


Define normalisation?

1093


What stored by the model?

1032


What is triggers and stored procedures?

925


What are 3 ways to get a count of the number of records in a table?

1055


To automatically record the time on which the data was modified in a table, which data type should you choose for the column?

939


How to turn off warning messages during php execution?

1019


What is spatial and temporal data?

975


Explain go command in sql server?

1008


What are various limitations of the views?

1043


When would you use it?

970


What are the different Topologies in which Replication can be configured?

1164


What does asynchronous call backs means?

1129