title: Retrieve rows from two children tables using a single query
body: <p>I have 3 tables: <code>readables</code>, <code>books</code> and <code>theses</code>. Both <code>books</code> and <code>theses</code> tables where children of the <code>readables</code> table. As you can see:</p>
  
  <pre><code>readables
    - id 
    - title
    - author
    - type
  </code></pre>
  
  <p><em>one or more books may have the same title but they differ on their call number and isbn</em></p>
  
  <pre><code>books
    - call_number 
    - isbn
    - isarchived
    - edition
    - book_id (references readables.id)
  </code></pre>
  
  <p><em>unlike books, theses titles are unique</em></p>
  
  <pre><code>theses
    - panelists
    - adviser
    - isarchived
    - book_id (references readables.id)
  </code></pre>
  
  <p>In my code, I have to query twice and combine the result to achieve my desired output:</p>
  
  <pre><code>//first query
  $bookResult = mysql_query("SELECT id, title, author, call_number, r.type FROM readables r INNER JOIN books b ON r.id=b.book_id
                               WHERE archived='false' AND title LIKE '$searched%' ORDER BY $sort LIMIT $start,$range");
  
  //second query
  $thesisResult = mysql_query("SELECT id, title, author, r.type FROM readables r INNER JOIN theses t ON r.id=t.book_id
                                 WHERE archived='false' AND title LIKE '$searched%' ORDER BY $sort LIMIT $start, $range");
  
  //combine results
  while($book = mysql_fetch_assoc($bookResult)){
    array_push($itemData['items'], $book);
    $itemData['count']++;
  }
  </code></pre>
  
  <p>How to retrieve rows from two children tables using a single query? </p>