Write a query to delete duplicate records in SQL SERVER
Answer Posted / rajnish kumar pandey
WITH TempTable(Col1, Col2, DuplicateCount)
AS
(
SELECT Col1, Col2,
ROW_NUMBER() OVER(PARTITION BY id, roles ORDER BY id) AS
DuplicateCount
FROM MainTable
)
DELETE
FROM TempTable
WHERE DuplicateCount > 1
GO
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Differentiate between SQL and ORACLE joins and write their syntax.
Can we install sql server 2016 on windows 7?
What is ssl in sql server?
What is sharding?
What is query optimization process?
What is data source document?
What is clr ddl trigger?
what is a mixed extent? : Sql server administration
Explain can you implement data mining in ssrs?
What is the parse query button used for?
What is the difference between commit and rollback?
How to list all schemas in a database?
What is acid mean in sql server?
Explain active/passive and active/active cluster configurations?
Explain about SQLOS?