I have some difficulties with the MySQL commands that I want to do.
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.
These are my data.
How do I group them into results with 5 minute intervals?
I already generated a query:
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
where I get the following:
I want my output to be like: