title: SQL: how to select single record for multiple id's on the basis of max datetime?
body: <p>I have the following SQL table,</p>
  
  <pre><code>Id      WindSpeed      DateTime
  --------------------------------------
  1       1.1            2009-09-14 16:11:38.383
  1       1.9            2009-09-15 16:11:38.383
  1       2.0            2009-09-16 16:11:38.383
  1       1.8            2009-09-17 16:11:38.383
  1       1.7            2009-09-19 16:11:38.382
  2       1.9            2009-09-19 16:11:38.383
  1       1.6            2009-09-19 16:11:38.383
  2       1.2            2009-09-20 16:11:38.383
  </code></pre>
  
  <p>I want to write a query which will return me the following result set from the above table:</p>
  
  <pre><code>Id      WindSpeed      DateTime
  --------------------------------------
  1       1.6            2009-09-19 16:11:38.383
  2       1.2            2009-09-20 16:11:38.383
  </code></pre>
  
  <p>The above reuslt contains the latest (on the basis of latest datetime for that id) single entry. Which means I have multiple record id's with datetime. </p>
  
  <p>I want to get the latest single entry of all id's.</p>