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
Can you use order by when defining a view?
What is a scheduled job or what is a scheduled task?
What is the difference in accessing db between sql server vs sql azure?
What is collation sensitivity? Explain different types.
Explain the flow of creating a cube? : sql server analysis services, ssas
What is snapshot parameter in ssrs?
What is partition index in sql server?
What is SQL Azure?
How to retrieve error messages using odbc_errormsg()?
What is the use of commit?
What is table value parameters (tvp)?
How to enable tcp/ip protocol on a sql server?
What is sql server profiler?
What are the default system databases in sql server 2000?
How to find the source of a table in sql server?