Group by time periods.

From: The Natural Philosopher <tnp_at_invalid.invalid>
Date: Mon, 29 Apr 2019 19:49:56 +0100
Message-ID: <qa7h0l$14h$1_at_dont-email.me>


[Quoted] I have a database with 5 minute samples of various quantities.

e.g. consider a simplified table with
id, value, timestamp

where 'id' is integer, 'value' is a float and 'timestamp' is datetime.

I would like to select in groups averaged by hour so that e,g., the output could be the average of 12 consecutive timestamps, plus a timestamp of the starting hour.

wring procedural code to do it is not hard but I wondered if in fact there was a way to do it in Mysql.

I thought of of 'group by hour', but that would be just 24 samples!

-- 
There is nothing a fleet of dispatchable nuclear power plants cannot do 
that cannot be done worse and more expensively and with higher carbon 
emissions and more adverse environmental impact by adding intermittent 
renewable energy.
Received on Mon Apr 29 2019 - 20:49:56 CEST

Original text of this message