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
Issues related in upgrading SQL Server 2000 to 2005 / 2008
You want to check the syntax of a complicated update sql statement without executing it. What command should you use?
What is the purpose of optimization?
What is a performance monitor?
Does dbcc checkdb requires db to be in single_user mode? : sql server database administration
How to create new table with "create table" statements?
What are the steps to take to improve performance of a poor performing query? : sql server database administration
Explain optimistic and pessimistic concurrency?
What is the difference between TRUNCATE and DROP?
Explain user defined views?
Your sql server is running out of disk space. You notice that there are several large files with ldf extensions what are these files?
How to create new tables with "select ... Into" statements in ms sql server?
where the connection string store in the database
How to optimize stored procedure optimization?
What is key set driven?