title: MySQL | How to select only one record of each category?
body: <p>I have a table that contains records with data, and each record belongs to a category. Lets say I have the table that following:</p>
  
  <pre><code>ID | Category | Title    | Date
  --------------------------------------
  1  | Cat 1    | Ttl 1    | 2013-02-18
  2  | Cat 2    | Ttl 2    | 2013-02-18
  3  | Cat 1    | Ttl 3    | 2013-02-20
  </code></pre>
  
  <p>What I like to do, is to get only one article by each category, and the one I will get must be the latest one in the table.</p>
  
  <p>In more depth, the result must looks like that:</p>
  
  <pre><code>ID | Category | Title    | Date
  --------------------------------------
  2  | Cat 2    | Ttl 2    | 2013-02-18
  3  | Cat 1    | Ttl 3    | 2013-02-20
  </code></pre>
  
  <p>As you can see I have only one record by each category (one for Cat 1 and one for Cat 2) and among the records of the Cat 1 I have the latest.</p>
  
  <p>How can be translated that in MySQL query ?</p>