I have the following problem, which sounds painfully simple but I am a bit at a loss :)
I have a table T1 with composite primary key F1 and F2.
There's a second table T2 that I want to use to delete records from T1. It als contains F1 and F2.
I want to do something like this
delete from T1
where T1.F1, T1.F2 in (select T2.F1, T2.F2 from T2);
Obviously, this does not work.
There are some solutions, but I find them not satisfying:
- A PL/SQL Loop and pass the key one by one
- Concatenate F1 and F2: where T1.F1 || T1.F2 in (select T2.F1 || T2.F2 from T2); -- but this is
very ugly.
Surely this must be possible in one simple SQL statement...
Thanks!
Rob