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 do you mean by SQL injection attack?
What are the advantages of sql azure?
How to generate create procedure script on an existing stored procedure?
Explain indexing and what are the advantages of it?
What are the different Topologies in which Replication can be configured?
What is triggers and stored procedures?
Does sql server 2016 have ssms?
What is a trigger and types of a trigger?
What the class forname () does?
Explain error handling in ssis?
What is the usage of sign function?
Explain what role entity and relationship play in an ER diagram.
Where are sql server usernames and passwords stored in the sql server?
What is local temp table?
What is indexed view?