title: Is there a way to GROUP BY a time interval in this table?
body: <p>I have a table like this one:</p>
  
  <pre><code>DateTime   A
  
  10:00:01   2 
  10:00:07   4
  10:00:10   2
  10:00:17   1
  10:00:18   3
  </code></pre>
  
  <p>Is this possible to create a query that returns me the average value of A each 10 seconds? In this case the result would be:</p>
  
  <pre><code>3 (4+2)/2
  2 (2+1+3)/3
  </code></pre>
  
  <p>Thanks in advance!</p>
  
  <p>EDIT: If you really think that this can not be done just say NO WAY! :) It's an acceptable answer, I really don't know if this can be done.</p>
  
  <p>EDIT2: I'm using SQL Server 2008. I would like to have different groupings but fixed. For example, ranges each 10 sec, 1 minute, 5 minutes, 30 minutes, 1 hour and 1 day (just an example but something like that)</p>