Statement of total precipitation for each hour, day or month
0
votes
3
answers
239
views
I store the data from the rain gauge in mySQL and needed help with listing the data. I save the data every 5 minutes and use the save date in the form of a timestamp.
At the end of each hour, therefore, HH: 55 will always be the maximum hourly total that I need to list for the day DD-MM-YYYY
Is it possible to list in the second SELECT a daily or monthly total of the data stored in this way? If so, how? Thank you very much.
EDIT:
Mysql version: 5.7.32-35-log I save the data every 5 minutes, but at the end of HH: 55 there is always the highest value for the hourly total precipitation.
So I have:
id | rain | timestamp
1 | 0.0 | 2021-10-04 12:00:00
2 | 0.0 | 2021-10-04 12:05:00
3 | 0.6 | 2021-10-04 12:10:00
4 | 0.9 | 2021-10-04 12:15:00
5 | 0.9 | 2021-10-04 12:20:00
6 | 1.4 | 2021-10-04 12:25:00
........
12 | 2.5 | 2021-10-04 12:55:00 // MAX rain
13 | 0.0 | 2021-10-04 13:00:00 // new hour and clean rain to 0.0
14 | 0.0 | 2021-10-04 13:05:00
15 | 0.6 | 2021-10-04 13:10:00
Asked by Novosad
(1 rep)
Oct 4, 2021, 08:47 AM
Last activity: Jun 12, 2025, 04:04 PM
Last activity: Jun 12, 2025, 04:04 PM