title: SQL Query -AVG Last two days
body: <p>I m trying to get Average of last two records and group them by name.    </p>
  
  <pre><code>OId     ODate        Value      Name
  1      05/01/2011   25          Mike
  2      05/01/2011   56      Peter
  3      05/01/2011   09      Robert
  4      06/01/2011   21          Mike
  5      06/01/2011   52      Peter
  6      06/01/2011   04      Robert
  7      10/01/2011   28          Mike
  8      10/01/2011   57      Peter
  9      10/01/2011   03      Robert
  
  SELECT Name, avg(Value) as avg_score
  FROM (
    SELECT Name, Value FROM S_ORDER BY dessc ODate 60
  )
  GROUP BY Name;
  </code></pre>
  
  <p>Thank you.!</p>