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 do you understand by a view? What does the with check option clause for a view do?
How to create a view using data from another view?
How can we call UDF(User Define Function) using C# code in ASP.net ?
Define normalisation?
What stored by the model?
What is triggers and stored procedures?
What are 3 ways to get a count of the number of records in a table?
To automatically record the time on which the data was modified in a table, which data type should you choose for the column?
How to turn off warning messages during php execution?
What is spatial and temporal data?
Explain go command in sql server?
What are various limitations of the views?
When would you use it?
What are the different Topologies in which Replication can be configured?
What does asynchronous call backs means?