I am working on a database project, and for sanity's sake I want to delete all of my problem data from the database while I test it's other features.
I currently have some queries written up to help me find my problem data sets like the code below:
SELECT Order_ID, Part_Number, COUNT(*)
FROM Temp_A
GROUP BY Order_ID, Part_Number
HAVING COUNT(*) > 1
Now I want to be able to delete all of the data I find with these query from my Temp Table. However putting the code in:
DELETE FROM Temp_A
WHERE IN (/*MY QUERY*/)
Doesn't seem to work, as I am getting a Syntax error. I've tried removing the IN
, changing the WHERE
to WITH
, I am not sure exactly how to structure this query to get it to do what I want it to do.