I'm trying to form a single query to do the following:
delete FROM table1 where table1.field1 < table1.field2
delete FROM table2 where table2.field3 = table1.field3 **Only use table1 rows selected above to be removed**
So I'm using logic in the first query to determine which rows I want to remove, and I need to use that logic to decide which table2 rows to remove as well, if they match field3 from the table1 row.
Anyone know how to join this into one string? I can't seem to figure it out.
Thanks
delete FROM table1 where table1.field1 < table1.field2
delete FROM table2 where table2.field3 = table1.field3 **Only use table1 rows selected above to be removed**
So I'm using logic in the first query to determine which rows I want to remove, and I need to use that logic to decide which table2 rows to remove as well, if they match field3 from the table1 row.
Anyone know how to join this into one string? I can't seem to figure it out.
Thanks