title: Select N records for each category and order by X
body: <p>I have a database table that contains blog posts. I want to show on the homepage one (or more) post for each category, ordering by date, for example. </p>
  
  <p>So my posts table looks like this: <code>id | title | description | cat | filename | date</code></p>
  
  <p>How would I create such a query? I've thought to use group-by or a subselect but I'm not sure if it's a good thing for performance... the table has a large number of records.</p>