title: get max date based on column value
body: <p>Assume I have the following table named <code>image_play</code> and have the following rows &amp; cols</p>
  
  <pre><code>+-------------------------------------------+
  |image_name | image_category  | image_date  |
  +-------------------------------------------+
  |a.jpg      | WSA             | 2015-02-10  |
  |b.jpg      | WSP             | 2015-02-09  |
  |c.jpg      | GSST            | 2015-02-09  |
  |d.jpg      | WSA             | 2015-02-09  |
  |e.jpg      | GSST            | 2015-02-08  |
  |f.jpg      | WSP             | 2015-02-08  |
  +-------------------------------------------+
  </code></pre>
  
  <p>From that table I want to select <code>MAX</code> date for each <code>image_category</code>. so the result would be</p>
  
  <pre><code>a.jpg      | WSA             | 2015-02-10
  b.jpg      | WSP             | 2015-02-09
  c.jpg      | GSST            | 2015-02-09
  </code></pre>
  
  <p>What I already try is making a query for each category like so:</p>
  
  <pre><code>SELECT * FROM image_play t JOIN (SELECT MAX(image_date) AS MAXDATE FROM image_play WHERE image_category='GSST')t2 ON t.image_date=t2.MAXDATE
  </code></pre>
  
  <p>But it's not working. please help me..thanks a lot.</p>