SELECT AVG( valor ) , HOUR( `timestamp` )
FROM tabela
WHERE DATE_SUB( `timestamp` , INTERVAL 1 HOUR )
GROUP BY HOUR( `timestamp` )
2 de 6
adicionou 42 caracteres ao conteúdo
user60252