How to retrieve duplicate rows in a table?
How to delete the duplicate entries in a table?
Answer Posted / nagabhushan adhikari
These are duplicates....
select distinct(col1),col2,col3.... into #temp from table
group by col1 having count(1) > 1
by the below delete duplicates
delete table from table A, #temp B where A.col1= B.col1
by this insert only a single record
insert into table select col1, col2,col3... from #temp
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
what are the different stages of Report Processing?
What is scheduled job and how to create it?
What is meant by referential integrity?
What is the use of commit?
Can you please explain the difference between primary keys and foreign keys?
What is the purpose of floor function?
What is the difference between an index and a unique index?
What is snapshot report?
Sql server reporting services vs. Crystal reports.
What is difference between group by and having?
Explain full-text indexing?
What is SubQuery in SQL Server 2008
What is primary key and example?
What are subqueries in sql server?
What is SQL Azure Federations?