title: Select ID for corresponding max date using GROUP BY
body: <p>My table structure as below</p>
  
  <pre><code>Category    Sex         Last Modified Date          Id
  7           2           2015-01-16                  87603
  7           1           2014-11-27                  87729
  7           2           2018-09-06                  87135
  7           1           2017-12-27                  87568
  </code></pre>
  
  <p>My sql query as below</p>
  
  <pre><code>SELECT
      MAX(Id) AS Id
  FROM 
      Table
  GROUP BY 
      Category, Sex
  </code></pre>
  
  <p>Result as below</p>
  
  <pre><code>87603
  87729
  </code></pre>
  
  <p>But I would like to get <strong>Id</strong> as Max  Last Modified Date. Correct result should be as below</p>
  
  <pre><code>87135
  87568
  </code></pre>