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
Explain nested join?
whats the maximum size of view state??
How we can refresh the view?
What is use of except clause?
How to create an index on an existing table in ms sql server?
What are the differences between user defined functions and stored procedures?
What are the advantages of using a stored procedure?
Once setting replication, can you have distributor on sql server 2005, publisher of sql server 2008?
What is tempdb in sql server?
Why we need sql server?
How many database files are there in sql server 2000?what are they?
I create a separate index on each column of a table. What are the advantages and disadvantages of this approach? : Sql server database administration
How to declare a cursor with "declare ... Cursor" in ms sql server?
Explain in brief how sql server enhances scalability of the database system?
What is database dimension? : sql server analysis services, ssas