title: Select unique barcode with max timestamp
body: <p>I'm trying to write an SQL query using Microsoft SQL Server. </p>
  
  <p>My table looks similar to this:</p>
  
  <pre><code>bardcode |  products |      timestamp
  
  1234     |  12       | 2013-02-19 00:01:00
  1234     |  17       | 2013-02-19 00:01:00
  432      |  10       | 2013-02-19 00:01:00
  432      |   3       | 2013-02-19 00:02:00
  643      |  32       | 2013-02-19 00:03:00
  643      |   3       | 2013-02-19 00:03:00
  123      |  10       | 2013-02-19 00:04:00
  </code></pre>
  
  <p>I'm trying to get a list of unique barcodes based on the most recent timestamps.</p>
  
  <p>Here is my not-working query I've been thinking of:</p>
  
  <pre><code>    SELECT DISTINCT [Barcode], [Timestamp]
      FROM [InventoryLocatorDB].[dbo].[Inventory]
      WHERE max([Timestamp]) 
  </code></pre>
  
  <p><strong>EDIT</strong> I'd like to retain the additional columns as well. Do I do a join or someting.</p>
  
  <p>For example I want to select the the barcode with the latest timestamp and would like all of the other column information to come with it e.g. products column</p>