Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Multi Row DELETEs
Multi-row DELETEs
I am trying to do something conceptually very simple.
I have 2 tables. I want to delete the records in one table, that don't exist in the other table.
Initial queries are:
Select c.agt_ref
from agt3 c, agt b
where c.agt_ref = b.agt_ref (+)
and b.agt_ref is null
37 rows selected. Elapsed: 00:00:00.74
select c.agt_ref
from agt3 c
minus
select a.agt_ref
from agt a
37 rows selected. Elapsed: 00:00:00.77
You would figure that deleting these records would be very simple. Yet, nothing works.
delete from AGT
where AGT_REF IN
(select c.agt_ref
from agt3 c
minus
select a.agt_ref
from agt a )
0 rows deleted. Elapsed: 00:00:00.72
Delete from AGT
where AGT_REF IN
(select c.agt_ref
from agt3 c, agt b
where c.agt_ref = b.agt_ref (+)
and b.agt_ref is null )
0 rows deleted. Elapsed: 00:00:00.80
I DO have DELETE privileges on the AGT table.
Am I missing something? Any ideas?
Rodger Lepinsky
ADP Systems Partnership
Winnipeg, Manitoba, Canada
Received on Mon Jun 09 1997 - 00:00:00 CDT