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 change my passwords (database, LDAP, and so on) without causing an outage?
What is triggers in ms sql server?
What is 3nf normalization?
What is a scheduled job or what is a scheduled task?
What is the difference between upgrade and migration in sql server?
What is the default fill factor value?
Describe triggers features and limitations?
What are the different types of sql server replication? : sql server replication
What is Service Broker in sql server 2012?
Find first and last day of current month in sql server
How to use “drop” keyword in sql server and give an example?
What is a coalesce function?
What is the process of normalising?
What is scan table/view and seek table/view when its occurs? : sql server database administration
What is the Disadvantage of indexed sequential file.