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
Describe and explain about SQL native client?
What Is Rdbms?
What is a cursor, index in sql?
How do I view a stored procedure in sql server?
What are the different types of sql server replication? : sql server replication
Define right outer join?
How to download and install microsoft .net framework version 2.0?
How to automatically create a log when an exception is being received into SQL Server?
What are commit and rollback in sql?
Are there issues when exporting SSRS reports into Microsoft Excel? When my users are trying to export a SSRS report into Microsoft Excel, one or two columns in the report appear to merge together. Why might this be?
What does it mean to normalize a database and why would you do it?
Give an example of why you would want to denormalize a database
How many levels of sp nesting are possible?
What is the purpose of floor function?
What do you know about system database? : SQL Server Architecture