Oracle will only delete from the so-called stored key table . This is a table whose key is saved as a result of the join. In other words, rows of a saved key table can appear only once as a result of a join.
- n -> 1 t1 t2. , Oracle t1 , t2.
. . OP :
create table a (n int primary key);
create table b (n int);
insert into a values(1);
insert into b values(1);
insert into b values(1);
b:
delete from (select * from a join b on a.n = b.n);
b? Oracle b row . , b - , . :
select a.*, a.rowid, b.*, b.rowid from a join b on a.n = b.n;
a.n | a.ROWID | b.n| b.ROWID
1 | AAAKUKAAEAAAAv8AAA | 1 | AAAKUMAAEAAAAwMAAA
1 | AAAKUKAAEAAAAv8AAA | 1 | AAAKUMAAEAAAAwMAAB