title: SQL SERVER How to select the latest record in each group?
body: <pre><code>| ID | TimeStamp | Item |
  |----|-----------|------|
  | 1  | 0:00:20   | 0    |
  | 1  | 0:00:40   | 1    |
  | 1  | 0:01:00   | 1    |
  | 2  | 0:01:20   | 1    |
  | 2  | 0:01:40   | 0    |
  | 2  | 0:02:00   | 1    |
  | 3  | 0:02:20   | 1    |
  | 3  | 0:02:40   | 1    |
  | 3  | 0:03:00   | 0    |
  </code></pre>
  
  <p>I have this and I would like to turn it into</p>
  
  <pre><code>| ID | TimeStamp | Item |
  |----|-----------|------|
  | 1  | 0:01:00   | 1    |
  | 2  | 0:02:00   | 1    |
  | 3  | 0:03:00   | 0    |
  </code></pre>
  
  <p>Please advise, thank you!</p>