title: Simple query in sql through aggregate function and group by clause
body: <p>I have a table like the picture bellow and I need to extract the id,name and date of the max datetime that has been grouped by the name.</p>
  
  <p><img src="https://i.stack.imgur.com/RHGqF.jpg" alt="enter image description here"></p>
  
  <p>I can get the max datetime through this query:</p>
  
  <pre><code>SELECT MAX(Table.Date),Table.name FROM Table GROUP BY Table.name
  </code></pre>
  
  <p>and the result is:</p>
  
  <p><img src="https://i.stack.imgur.com/oyFP2.jpg" alt="enter image description here"></p>
  
  <p>To extract the information of max datetime that has been grouped by the name, I've had this query:</p>
  
  <pre><code>SELECT t1.name, t1.Date, t1.id
  FROM Table t1
  WHERE t1.Date in (SELECT MAX(t2.Date)
  FROM Table t2
  GROUP BY t2.name)
  </code></pre>
  
  <p>the result is:</p>
  
  <p><img src="https://i.stack.imgur.com/YUwKI.jpg" alt="enter image description here"></p>
  
  <p>but do not need the highlighted data. because between 'D's the 2014-01-12 has the max date.</p>
  
  <p><strong>NOTE:</strong> I can solve the problem through JOIN expression.</p>
  
  <p>but because of <strong>saving time</strong> I need a simple query.</p>