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 is the meaning of sql server?
What is a table called, if it has neither cluster nor non-cluster index? What is it used for?
What the class forname () does?
Explain the microsoft sql server delete command?
What are data resources?
What structure can you implement for the database to speed up table reads?
How is sql used in sql server?
What is normalization? Describe its different types.
Explain about merge replications?
How do I start sql server?
How much does sql server 2016 cost?
What do you mean by an execution plan? Why is it used? How would you view it?
What is it unwise to create wide clustered index keys?
What are cascading parameters in ssrs reports?
Tell me what are the advantages of using stored procedures?