I have the results of a SELECT statement that I would like to turn around and use to delete the matching rows from a different table with the same data. I don't have the specific details from the SELECT -- just the rows returned.
For example, if I have the tables
table_1
name | value
--------------
Bob | 5
Ben | 14
Bev | 8
table_2
name | value
--------------
Bob | 5
Bill | 2
Biff | 4
And I'm given the results of a SELECT from the first table that returns Bob's row, how can I use that to delete Bob from the second table?
Edit To clarify more what I'm doing, I have a script that is going through several pairs of backup/live tables and finds rows that are new and updated (that's the SELECT part I'm given -- its a change log). Now, I need to delete some of those new rows but all I have to work with is the raw data from the change log and the name of the table. For inserts this isn't a problem:
INSERT INTO table_name <row data here> -- Don't need column names
I was hoping DELETE had a similar schema-free way of deleting stuff by matching raw data similar to how an EXCEPT clause works.