title: Average of data for every 5 minutes in the given times
body: <p>I have a problem with MySQL. I need the average of data from MySQL between two particular times.</p>
  
  <p>For that, I'm using:</p>
  
  <pre><code>select avg(Column) 
  from Databasename.tablename 
  where datetime BETWEEN '2012-09-08 00:00:00' AND '2012-09-08 15:30:00'
  </code></pre>
  
  <p>Now, what I need is the average of data for every 5 minutes, in the given times. By using this:</p>
  
  <pre><code>select avg(Column) 
  from Databasename.Tablename 
  where datetime BETWEEN '2012-09-08 15:00:00' 
                     AND '2012-09-08 15:30:00' + 'INTERVAL 5minutes'
  </code></pre>
  
  <p>It's not showing any error but showing <code>NULL</code>.</p>
  
  <p>How do I get the data for every 5mins within two particular time periods?</p>