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

CGN007
Posted by CGN007 under Sql Server category on | Points: 40 | Views : 1595
 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
Hi,

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

http://www.youtube.com/watch?v=Ly-YqPVdVOk&feature=youtu.be


Best Regards,
Sql Expert
http://learnsqltips.blogspot.com/

Login to post response