title: MySQL group by intervals in a date range
body: <p>I am going to be graphing netflow data stored in a MySQL database, and I need an efficient way to get the relevant data points. They records are stored with the date as an int for seconds since epoch. I Would like to be able to something like:</p>
  
  <pre><code>Select SUM(bytes) from table where stime &gt; x and stime &lt; Y  
  group by (10 second intervals)
  </code></pre>
  
  <p>Is there anyway to do this? or, would it be faster to handle it locally in python? even for a 500K row table?</p>
  
  <p><strong>EDIT</strong>
  My Mistake, the time is stored as an unsigned double instead of an INT. 
  I'm currently using <code>GROUP BY (FLOOR(stime / I))</code> where I is the desired interval.</p>