delete duplicates with sql
snippet in sql

delete duplicates with sql

user9865

WITH cte AS (
    SELECT 
        *, 
        ROW_NUMBER() OVER (
            PARTITION BY 
                Name,
                Age
            ORDER BY 
                Name,
                Age
        ) row_num
     FROM 
        TableName
)
delete FROM cte
WHERE row_num > 1;