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

calling or handling data without c# model

 calling or handling data without c# model Yes, it is possible to read data in a C# Web API without explicitly defining model classes for ev...