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
How do I get Report Builder to generate a parameter that can be set by users viewing the report?
How do database indexes work?
What is store procedure?
Do you know what is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure?
What are the advantages of user-defined functions over stored procedures in sql server?
What is a dataset and what are the different types of datasets?
Tell about MOM Tool(Microsoft Operator Manager)?
How to run sql server 2005 books online on your local system?
What is the current pricing model of SQL Azure?
Data table as parameter in sql server?
Why it is recommended to avoid referencing a floating point column in the where clause?
Which language rdl files made of?
What is user-defined inline table-valued function?
What are the steps to process a single select statement?
Explain cursor as data base object?