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 does it mean to be in union?
what are different types of backups available in sql server? : Sql server database administration
What are the different type of replication in sql server?
What is database mirroring?
What is relationship? What number of sorts of relationship are there?
What are the tables in sql?
what is a live lock? : Sql server database administration
Explain “@@rowcount” and “@@error” in sql server?
How to rebuild indexes with alter index ... Rebuild?
How to include date and time values in sql statements?
What are sql azure firewall rules?
Explain about integration services of Microsoft SQL server?
How many cores do I need for sql server 2016?
What is sqlcmd?
What's the information that can be stored inside a bit column?