Sqlserver
 sql >> Database >  >> RDS >> Sqlserver

È necessario eliminare i record duplicati dalla tabella utilizzando 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