title: Grouping in 5 minute intervals within a time range
body: <p>I have some difficulties with the MySQL commands that I want to do.</p>
  <p>I need to generate some graphs obtaining a query in MySQL in intervals, for example, of 5 minutes generating an average of a data with the AVG method.</p>
  <p>These are my data.</p>
  <p><a href="https://i.stack.imgur.com/L0Q5J.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L0Q5J.png" alt="enter image description here" /></a></p>
  <p>How do I group them into results with 5 minute intervals?</p>
  <p>I already generated a query:</p>
  <pre><code>SELECT FROM_UNIXTIME(FLOOR((UNIX_TIMESTAMP(created_at)) DIV 300)*300) AS t, site_id, AVG(response_time) as c 
  FROM sites_health_metrics 
  WHERE site_id = 1 
  AND created_at BETWEEN '2021-08-23 20:40:00' AND '2021-08-23 21:40:00' 
  GROUP BY t ORDER BY t
  </code></pre>
  <p>where I get the following:</p>
  <p><a href="https://i.stack.imgur.com/QrnrU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QrnrU.png" alt="enter image description here" /></a></p>
  <p>I want my output to be like:</p>
  <p><a href="https://i.stack.imgur.com/fU7zI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fU7zI.png" alt="enter image description here" /></a></p>