Sunday, 18 February 2024

delete duplicate records based on the Id

 WITH CTE AS (

    SELECT ProductId,

           -- Add other columns as needed

           ROW_NUMBER() OVER (PARTITION BY ProductId ORDER BY (SELECT NULL)) AS RowNumber

    FROM Master.VehicleType

)

DELETE FROM CTE WHERE RowNumber > 1;

No comments:

Post a Comment

c#

 https://github.com/dcyuksel/Result