Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> SQL Delete with table-join syntax ?

SQL Delete with table-join syntax ?

From: Dan Richards <dan_at_eurographics.co.uk>
Date: Tue, 22 Jun 1999 14:39:03 +0100
Message-ID: <376F91F7.2EF69271@eurographics.co.uk>


Hi

I have 1k records in TABLE_A and 1m in TABLE_B. They both have the same primary key, and some records in A overlap those in B.

I am trying to delete records in B where newer ones exist in A, and then append all of A to B.

My problem is the performance of deleting from B using the following syntax:

DELETE FROM TABLE_B
WHERE B_KEY IN (SELECT A_KEY FROM TABLE_A); The following syntax doesn't work for deletes...

DELETE FROM TABLE_A,TABLE_B
WHERE A_KEY=B_KEY(+)
 AND B_KEY IS NULL; ..and trying to delete from a view that joins these 2 tables raises ORA-01752: cannot delete from view without exactly one key-preserved table.

Performance is my main criteria here - any advice ?

Dan Received on Tue Jun 22 1999 - 08:39:03 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US