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 collation sensitivity?
What is snapshot parameter in ssrs?
What is change tracking in sql server?
Where sql server user names and passwords are stored in sql server? : sql server database administration
How to use old values to define new values in update statements in ms sql server?
How do I create a partition table in sql server?
Explain how you can configure a running aggregate in SSRS?
last function used in MS Access to convert sql what function will use in sql
Does sql server 2016 have ssms?
What is the difference between cube operator and rollup operator? : SQL Server Architecture
What is optimistic concurrency?
What will be the maximum number of indexes per table?
What is de-normalization and what are some of the examples of it?
Determine when an index is appropriate?
What is the use of partition by in sql server?