Da du bruger SQL Server 2005+, kan du bruge CTE til at udføre dette:
;WITH cte AS
(
SELECT ROW_NUMBER() OVER (PARTITION BY Col1, Col2, Col3 ORDER BY (SELECT 0)) RN
FROM yourtable
)
DELETE FROM cte
WHERE RN > 1
Da du bruger SQL Server 2005+, kan du bruge CTE til at udføre dette:
;WITH cte AS
(
SELECT ROW_NUMBER() OVER (PARTITION BY Col1, Col2, Col3 ORDER BY (SELECT 0)) RN
FROM yourtable
)
DELETE FROM cte
WHERE RN > 1