title: Sql query with multiple tables
body: <p>I'm not very used to SQL queries, but I have to do this query that involves a lot of tables. Here they are:</p>
  
  <p>(Note: <code>id</code> is always the <code>PRIMARY KEY</code>.)</p>
  
  <pre><code>A(id, name)
  B(id, title, a_id, FOREIGN KEY(a_id) REFERENCES A(id))
  C(id, d_id, b_id, FOREIGN KEY (d_id) REFERENCES D(id), FOREIGN KEY REFERENCES (b_id) REFERENCES B(id))
  D(id, content)
  E(id d_id, a_id, c_id, FOREIGN KEY (d_id) REFERENCES D(id), FOREIGN KEY (a_id) REFERENCES A(id),  FOREIGN KEY (C_id) REFERENCES c(id))
  </code></pre>
  
  <p>I need to retrive all the rows from table <code>E</code>.</p>
  
  <p>This is the query I wrote:</p>
  
  <pre><code>SELECT *
  FROM E
  LEFT JOIN D ON E.d_id = D.id
  LEFT JOIN A ON E.a_id = A.id
  LEFT JOIN B LEFT JOIN A ON B.a_id = B.id
  ON C.b_id = B.id
  LEFT JOIN D ON C.d_id = D.id
  ON E.c_id = C.id
  </code></pre>
  
  <p>But it gives me a runtime error: </p>
  
  <blockquote>
    <p>Ambiguous column name "ID";</p>
  </blockquote>
  
  <p>Can anybody give me a hint to solve this problem?</p>