Seamless Solutions, Tailored Integration info@wkintegrations.com Kendal, Cumbria, UK

Blog

Remove Duplicate Rows from a SQL Table

A small reminder for myself:

delete t from
(
SELECT *
, DupRank = ROW_NUMBER() OVER (
              PARTITION BY PurchaseOrderNumber, LineNumber
              ORDER BY (SELECT NULL)
            )
FROM [PurchaseOrderLines]
) as t
where DupRank > 1

Need help with an integration?

Get in touch