adspace
How to delete exactly duplicate records from a table?
Answer Posted / Mohammad Shavab
You can delete exact duplicate records from a table using the ROW_NUMBER() window function in SQL Server. Here is an example query: DELETE FROM [YourTable] WHERE ROW_NUMBER() OVER (ORDER BY [Column1], [Column2] ...) = ROW_NUMBER() OVER (PARTITION BY [Column1], [Column2]... ORDER BY [Column1], [Column2]...). Replace [YourTable] and the column names with those in your actual table.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is clustered index
Does view occupy space?
How to connect php with different port numbers?
How raid can influence database performance?
How can I check that whether automatic statistic update is enabled or not?
What is sql or structured query language?
What are the pros and cons of putting a scalar function in a queries select list or in the where clause?
What is in place upgrade in sql server?
Is it possible to have clustered index on separate drive from original table location?
Why use identity in sql server?
Can you index views?
what is the difference between openrowset and openquery?
What kind of problems occurs if we do not implement proper locking strategy?
List the ways in which dynamic sql can be executed?
Can one drop a column from a table?