Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

delete duplicate sql

WITH CTE AS(
   SELECT [col1]
           ,[col2]
           ,[col3]
     ,
       RN = ROW_NUMBER()OVER(PARTITION BY [col1],[col2],[col3] ORDER BY [col1],[col2],[col3])
   FROM [dbo].[table1]

)
DELETE FROM CTE WHERE RN > 1
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #delete #duplicate #sql
ADD COMMENT
Topic
Name
7+9 =