delete duplicates from table
ALTER PROCEDURE [Daily].[sp_deleteDuplicates_UFABranchAccountingDateChange]
AS
WITH CTE([AccountNo],
DuplicateCount)
AS (
SELECT [AccountNo],
ROW_NUMBER() OVER(PARTITION BY [AccountNo]
ORDER BY [AccountNo]) AS DuplicateCount
FROM CreditDataStore.Monthly.UFABranchAccountingDateChange)
DELETE FROM CTE
WHERE DuplicateCount > 1;
No comments:
Post a Comment