Tuesday, 24 December 2019

How to Delete duplicate rows from table in sql


How to Delete duplicate rows from table in sql server

WITH cte AS (
    SELECT 
Barcode,
        ROW_NUMBER() OVER (
            PARTITION BY 
                Barcode
            ORDER BY 
               Barcode
        ) row_num
     FROM 
        Isuued_Product_DetailsLog
)
DELETE FROM cte
WHERE row_num > 1;


I hope this will help to you

No comments:

Post a Comment