sql >> Base de Datos >  >> RDS >> Sqlserver

Necesita eliminar registros duplicados de la tabla usando row_number()

WITH cte AS
(
    SELECT ROW_NUMBER() OVER(PARTITION by ID ORDER BY name) AS Row
    FROM test
)

DELETE FROM cte
WHERE Row > 1