Is there a faster way???

Is there a faster way???

Post by Andy » Sun, 31 Dec 1899 09:00:00



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

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!

 
 
 

Is there a faster way???

Post by Andy » Sun, 31 Dec 1899 09:00:00


Beautiful!  Thank you very much...You just taught me something!

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!