The following must be what they were referring to. First run this query to make sure you are indeed getting the records you want to delete:;WITH cte AS( SELECT *, ROW_NUMBER() OVER (PARTITION BY header,F1,F2,F3,F5,F6 ORDER BY F4) AS RN FROM YourTable) SELECT * FROM cte WHERE RN > 1;
If youare satisfied, run this to delete:;WITH cte AS( SELECT ROW_NUMBER() OVER (PARTITION BY header,F1,F2,F3,F5,F6 ORDER BY F4) AS RN FROM YourTable) DELETE FROM cte WHERE RN > 1;