title: Delete Oracle with join tables
body: <p>I have a table that has three columns ( primary key) and I need a delete sentece that allows me to remove the elements I don't need , using a join with the this table and other table, I've tried two delete sentences but they are not working as expected:</p>
  
  <p><strong>First One</strong>: This one gets the values I dont need and they are removed from table A, but the issue here is it deletes the values from Table B and C too and those rows can't be removed</p>
  
  <pre><code>DELETE
  FROM
    (SELECT A.*
    FROM TABLE_A A
    JOIN TABLE_B B
    ON A.CODE  =B.CODE
    JOIN TABLE_C C
    ON B.PRODUCT           =C.PRODUCT           
    WHERE B.VALUE       &gt;10000
    AND C.RANGE NOT  IN (4006, 4005, 4004, 4003, 4002, 4001)
    );
  </code></pre>
  
  <p>**Second One:**The problem with this one is that it removes all the rows from table A, but if I test the query ( select) it returns 5 rows, the ones that should be removed.</p>
  
  <pre><code>DELETE
  FROM A WHERE EXIST
    (SELECT A.*
    FROM TABLE_A A
    JOIN TABLE_B B
    ON A.CODE  =B.CODE
    JOIN TABLE_C C
    ON B.PRODUCT           =C.PRODUCT   
    WHERE B.VALUE       &gt;10000
    AND C.RANGE NOT  IN (4006, 4005, 4004, 4003, 4002, 4001)
    );
  </code></pre>
  
  <p>So has anyone any idea of what I could be doing wrong?</p>