how to delete duplicate rows from table in sql server

Answer Posted / gerry

delete from my_table where my_primary_key in
(select a.primary_key from my_table a, my_table b
where not a.my_primary_key = b.my_primary_key
and [insert restriction that makes the 2 rows the same]
)

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between row_number and dense_rank?

438


What is an index. What are the types?

582


What is service broker?

581


What is a fill factor?

616


How retrieve field names from the table in SQL through JAVA code?

1396






How does normalization work?

500


How do you manipulate data?

488


What is the difference between coalesce() & isnull()?

530


How to connect of datebase with sql express.?

618


What are the types of subquery?

546


What is 2nf in normalization?

532


Why use view instead of a table?

515


What is change data capture (cdc) feature?

584


Can we perform backup restore operation on tempdb? : sql server database administration

582


If a user does not have permission to a table, but has permission to a view created on it, will he be able to view the data in table?

552