How to retrieve duplicate rows in a table?
How to delete the duplicate entries in a table?
Answer Posted / mon
DELETE FROM MyTable
LEFT OUTER JOIN (
SELECT MIN(RowId) as RowId, Col1, Col2, Col3
FROM MyTable
GROUP BY Col1, Col2, Col3
) as KeepRows ON
MyTable.RowId = KeepRows.RowId
WHERE
KeepRows.RowId IS NULL
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the most common trace flags used with sql server?
How to create “dependant” parameter “make, model, year”
Which table keeps the locking information?
How can I get data from a database on another server?
What are the different types of indexes?
To automatically record the time on which the data was modified in a table, which data type should you choose for the column?
What are the general features of sql server management studio? : sql server management studio
How to delete all rows with truncate table statement in ms sql server?
Explain about integration services of Microsoft SQL server?
What is database black box testing?
You want to implement the many-to-many relationship while designing tables. How would you do it?
query processing
Do you know how to store and query spatial data?
How to get a list of columns using the "sys.columns" view in ms sql server?
I applied Transactional with updatable subscriptions replication on 2 tables now i want to delete those 2 tables but i cannot delete those tables as replication is running how can i stop replication for those 2 tables(but i don't want to delete those replicated tables but i need to stop the replication) how can i do that