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 RAID? What are the different types of RAID configurations?
How to add the custom code in Report?
Please differentiate between a local and a global temporary table?
What are the transaction properties?
Can a rule be bound to any column of any data type?
Which are the new data types introduced in sql server 2008?
What is scheduled job and how to create it?
What is a deadlock and what is a live lock?
What are the approximate numeric data types?
What is the native system stored procedure to execute a command against all databases?
What is best institute to Learn DotNET And SQL in chennai?
How to concatenate two character strings together?
How to create a new table in a given schema?
How to execute a sql statement using odbc_exec()?
What are the tool windows in sql server management studio? : sql server management studio