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
What is the difference RDBMS and Graph Database?
What are three ways you can use an identity value inside a trigger? Why would you prefer one way over another?
What are the source of constraints?
Does view occupy space?
Can you insert NULL in unique column?
Does the unique constraint create an index?
What is rank function?
do you know how to configure db2 side of the application? : Sql server database administration
How do I schedule a sql server profiler trace?
Can I use sql azure as a backup with log shipping or database mirroring?
What is xdr?
What are the advantages of using stored procedures in sql server?
What is the recursive stored procedure in sql server?
can you instantiate a com object by using t-sql? : Sql server database administration
Is sql server free?