title: Query to get max Id from each Kind
body: <p>I need to get max X.Id from each Specific kind, Example:</p>
  
  <p>Table:</p>
  
  <pre><code>Id | Kind
  ---------
  1  |  20
  2  |  20
  3  |  15
  4  |  15
  ---------
  </code></pre>
  
  <p>My query needs to get the Ids 2 and 4, because my kinds are 15 and 20, this is my current query:</p>
  
  <pre><code>SELECT max(Id)
     FROM X
  WHERE KIND = 15 or KIND = 20
  </code></pre>
  
  <p>But this query only returns id 4. I need 2 and 4, the max Id for each kind.
  I don't want to run more than one query. 
  With subqueries and more than one query I know how to do.</p>
  
  <p>I would like to know how to do with only one query.</p>
  
  <p>Can anyone help me?</p>