How To delete duplicate record from a particular table?

Answer Posted / srinivasan

WITH CTE AS
(
SELECT * ,ROW_NUMBER() OVER (PARTITION BY ID,NAME
ORDER BY ID DESC) AS RNUM FROM TABLE A
)

DELETE CTE WHERE RNUM >1

IF U HAVE ANY MORE DOUBTS
MAIL ME MCAVASAN@GMAIL.COM

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is Dependency Injection and provide example?

626


What do you understand by mirroring?

576


What is the difference between truncate and delete commands?

571


What is sql server english query?

551


What is a sql join?

578






What are the purposes of floor and sign functions?

546


What is the use of set nocount on/off statement?

629


Write SQL queries on Self Join and Inner Join.

621


What do you mean by a Composite primary key?

600


Explain what are the database objects? : SQL Server Architecture

581


How the authentication mode can be changed?

613


What is a document index?

595


How to create a Master database in SQL server ?

560


What is the parse query button used for?

614


What is scd (slowly changing dimension)? : sql server analysis services, ssas

602