Deleting dulpicate rows using ROW_NUMBER() ,PARTITION BY and Common Table Expression(CTE)

Posted by CGN007 under Sql Server category on | Points: 40 | Views : 2047
 WITH employeeCTE AS 
SELECT ROW_NUMBER() OVER (PARTITION BY emp_name ORDER BY emp_id) AS count_no FROM employee
DELETE FROM employeeCTE WHERE count_no > 1

Comments or Responses

Posted by: Sqldev on: 3/11/2013 Level:Starter | Status: [Member] | Points: 10

Below video have complete information about CTE like what is CTE , properties of CTE and examples for CTE in sql server.

Best Regards,
Sql Expert

Login to post response