I have a MYSQL DB with two columns, one is the temperature and the other one is the time in which the temperatura was read, like http://pastebin.mozilla.org/1860064 . The temperature USUALLY have a 5minutes difference between reads, but this is not always with this time gap.
What I need to figure out is a algorithm to read all the values and save the average of every hour of read, so temperature will be saved on the db with one temperature per hour, 24 reads per day, and it would save in another db's table.
For example:
It would save with the average temperature and with the date 2012-10-07 10:00:00,
Was I clear?