Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Is there a faster way???
Hi,
I have the following query that I have written to delete all of
the rows in a table if it finds a matching row (based upon 4
columns) in another table. The 1st table has a few hundred rows
and the 2nd table has a few hundred thousand rows. The query is
running for a very long time. Is there a more efficient way to
code this? Here is the query:
Delete from Frt.Tld_data_in a
where a.frt_order in
(select frt_order from frt.freight b
where a.frt_order = b.frt_order) and
a.bl in
(select bl from frt.freight b
where a.bl = b.bl) and
a.pro in
(select pro from frt.freight b
where a.pro = b.pro) and
(a.accessorial_rc = 'RPAY');
Thanks alot!
Andy
![]() |
![]() |