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
What is an index in sql?
What is 'Join' and explain its various types.
What is subquery explain with example?
What changes in the front end code is needed if mirroring is implemented for the high availability? : sql server database administration
What is enhanced database mirroring in sql server 2008?
How to enable/disable indexes?
How do I create a partition table in sql server?
What is reference section?
How to write a query with a full outer join in ms sql server?
What do you understand by triggers and mention the different types of it?
Are resultset updatable?
Sql server reporting services vs. Crystal reports.
Which database stores information about replication?
How can you insert null values in a column while inserting the data?
What does null mean?