title: Oracle - Partial Delete on Junction Table
body: <p>I want to perform multiple deletes on a junction table in one request/query. Complexity is the data I want to delete don't share the same pattern.</p>
  
  <p>Example :
  I have 3 tables, <strong>Tab1 Tab2 and TabJct3</strong>. TabJct3 is the junction table of Tab1/Tab2. Simple auto inc for the ID of Tab1/Tab2. TabJct3 has 2 ID, one for each "junctionned" table. Tab1Id and Tab2Id</p>
  
  <p>Records are :</p>
  
  <p>Tab1 : T1R1</p>
  
  <p>Tab2 : T2R1, T2R2, T2R3</p>
  
  <p>TabJct3 : [T1R1, T2R1], [T1R1, T2R2], [T1R1, T2R3]</p>
  
  <p>Suppose I want to delete these records from TabJct3 : [T1R1, T2R1], [T1R1, T2R2] (but not [T1R1, T2R3]).</p>
  
  <p>An example of query would be (naive) :</p>
  
  <p><code>DELETE FROM TabJct3 WHERE (SELECT Tab1Id, Tab2Id FROM TabJct3 WHERE Tab1Id = 'T1R1' AND Tab2Id = 'T2R1') AND (SELECT Tab1Id, Tab2Id FROM TabJct3 WHERE Tab1Id = 'T1R1' AND Tab2Id = 'T2R2')</code></p>
  
  <p>I want to avoid specific subselects, because it does the same amount of requests as there are records to delete.</p>
  
  <p>Is there any alternative to one subselect per record?</p>