title: SQL Chaining joins
body: <p><strong>EDIT: The isssue was mismatching data the B-ids in tables A_B and B_C had no overlap</strong></p>
  
  <p>I have the following tables:</p>
  
  <ul>
  <li>A(id, …)</li>
  <li>A_B(a_id, b_id)</li>
  <li>B_C(b_id, c_id)</li>
  <li>C_D(c_id, d_id)</li>
  <li>D(id, value, …)</li>
  </ul>
  
  <p>Where I want some rows from A based on the value of the row in D.
  The tables A_B, B_C and C_D are just id mappings from one table to another.</p>
  
  <p>I was trying to get to something that would look something like this:</p>
  
  <pre><code>select * from A where D.value = "true"
  </code></pre>
  
  <p>I got this far:</p>
  
  <pre><code>select * from A 
  inner join A_B on A_B.a_id = A.id
  inner join B_C on B_C.b_id = A_B.b_id
  </code></pre>
  
  <p>which is just an empty table.</p>
  
  <p>I am starting to think that I am approaching this issue in the wrong way or perhaps have misunderstood how one should go about joining tables.</p>