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 the difference between executequery () and executeupdate ()?
What are tables in sql server?
Explain sql delete command?
What is it’s similarity with sql server?
How to include text values in sql statements?
Mention what are the core components of ssrs?
What are the restrictions while creating batches in sql server?
What is page-level compression?
What are the new features are introduced in sql server 2012 reporting services?
How to return the second 5 rows in ms sql server?
How to get a list of columns in a view using "sys.columns" in ms sql server?
How does normalization work?
Write SQL queries on Self Join and Inner Join.
Explain about the command-line tool SQLCMD?
Explain trigger and its types?