title: SQL query to join these 3 tables to remove spurious rows - OWNER, TYPE, PERSON
body: <p>I'm having some trouble joining these 3 tables. </p>
  
  <pre><code>Table1
  OWNER     TYPE
  O1        T1
  O1        T2
  O2        T1
  
  Table2
  OWNER     PERSON
  O1        P1
  O1        P2
  O2        P1
  
  Table3
  TYPE     PERSON
  T1       P1
  T2       P2
  T1       P2
  </code></pre>
  
  <p>I want to do a join on all 3 tables so my output would be:</p>
  
  <pre><code>FinalTable
  OWNER     TYPE     PERSON
  O1        T1       P1
  O1        T2       P2
  O2        T1       P2
  O1        T1       P2
  </code></pre>
  
  <p>I'm basically demonstrating how 5NF removes spurious rows. When I join any 2 combinations of the table I get extra data (which is what I expect).</p>
  
  <p>I'm having difficulty joining the third table though, I've never had to work with joining all 3.</p>
  
  <p>This is my query so far:</p>
  
  <pre><code>select r1.*, r2.PERSON from table1 r1, table2 r2, table3 r3
  where r1.OWNER = r2.OWNER and r2.PERSON = r3.PERSON 
  </code></pre>
  
  <p>My output returns 8 rows and some are duplicated. I've tried playing around with the query but it only increases the rows further. </p>
  
  <p>My query is based on an ORACLE APEX tutorial book I have but it isn't joining 3 tables that are laid out like mine. </p>
  
  <p>How do I join these 3 tables to remove spurious rows that I get after joining 2?</p>