I am trying to do an SQL query where I group the result in time segments, that is, calculate the average of a data every 5 min, my query for now goes like this:
SELECT DATE AS DATE, method AS METHOD, red AS red, state AS STATE
FROM table
WHERE STATE = 155
GROUP BY DATE