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
Tell me in brief how sql server enhances scalability of the database system?
What do you think of this implementation? Can this be implemented better?
Can sub report data source be different from that of the parent report?
What do you understand by the denormalisation?
you accidentally delete the msdb database what effect does this have on your existing sql databases, and how do you recover? : Sql server administration
How can we check the sql server version?
Explain syntax for disabling triggers?
What is the purpose of object explorer and its features? : sql server management studio
Why transaction is important?
How to concatenate two character strings together?
How to generate create function script on an existing function?
What is used to replicate sessions between instances in coldfusion clusters?
What is RMS migrations?
what kind of lan types do you know? : Sql server database administration
What stored by the master?