I have a table that I have managed to duplicate a lot of rows by accident. The id column is auto increment and has a foreign key constraint. What I would like to do is delete all rows where there is not a constraint that is active. Is this possible?
EDIT
This query gives me a list of the IDS of the records that need deleting, is there a nice way of editing this to delete after?
SELECT WHL_LEVEL_ID
FROM [RMIS].[dbo].[WHL_LEVEL_DETAIL]
except
select WHL_LEVEL_ID
from [RMIS].[dbo].[WHL_SKU_LOCATION]