title: Query max time (latest) by id SQL Server
body: <p>I have a similar table:</p>
  
  <pre><code>ID     | Name    | Time
  -------|---------|-----------------------------
  111    | AAA     | 2015-11-05 15:39:24.000
  222    | BBB     | 2015-11-04 11:29:11.000
  111    | AAA     | 2015-11-02 13:12:10.000
  333    | CCC     | 2015-11-05 15:39:24.000
  111    | AAA     | 2015-11-01 15:39:24.000
  </code></pre>
  
  <p>I would like to get the latest <code>Time</code> for every <code>ID</code>. My output would look something like this:</p>
  
  <pre><code>ID     | Name    | Time
  -------|---------|-----------------------------
  111    | AAA     | 2015-11-05 15:39:24.000
  222    | BBB     | 2015-11-04 11:29:11.000
  333    | CCC     | 2015-11-05 15:39:24.000
  </code></pre>
  
  <p>Please help me formulate the query!</p>
  
  <p>Can I use <code>max(Time)</code> to get latest <code>Time</code>?
  Do I need to JOIN the table with itself to be able to list <code>max(Time)</code> for all <code>ID</code>s?</p>