title: How do you limit compound records in MYSQL?
body: <p>I've been working with MYSQL for a few years now, and I often find myself wondering about this problem, but have never gotten around to researching it until now. So here goes. Let's say I have a table of authors, and a table of books. Each book has a field to link it to an author.</p>
  
  <p>Now let's say I want to get an author and his books, all in one set.</p>
  
  <pre><code>SELECT * FROM authors, books WHERE books.author = authors.id
  </code></pre>
  
  <p>No problem so far. Now for the tricky part: how do I get, say, 5 authors AND his books?</p>
  
  <p>if I do:</p>
  
  <pre><code>SELECT * FROM authors, books WHERE books.author = authors.id LIMIT 5
  </code></pre>
  
  <p>I'll just wind up getting the first 5 books linked to a single author. </p>
  
  <p>Is that clear enough? Is this possible to do in MYSQL, or do I have to resort to doing it in code (which I don't want to do)?</p>
  
  <p>Thanks much!</p>