title: TSQL selecting distinct based on the highest date
body: <p>Our database has a bunch of records that have the same invoice number, but have different dates and different notes.</p>
  
  <p>so you might have something like</p>
  
  <pre><code>invoice    date         notes
   3622      1/3/2010     some notes
   3622      9/12/2010    some different notes
   3622      9/29/1010    Some more notes
   4212      9/1/2009     notes
   4212      10/10/2010   different notes
  </code></pre>
  
  <p>I need to select the distinct invoice numbers, dates and notes. for the record with the most recent date.</p>
  
  <p>so my result should contain just</p>
  
  <pre><code>3622      9/29/1010    Some more notes
  4212      10/10/2010   different notes
  </code></pre>
  
  <p>how is it possible to do this?
  Thanks!</p>