'Use latest available data in mysql database
I import some data into mysql multiple times during a day, this data has solar forecast information, ie it forcasts how much power your solar panels should make, today, tomorrow etc.
The closer to the time / date it updates the forcast to a more accurate forecast. All i get is a timestamp, and a value. (The timestamp is obv important, since it relates to the period I need the information for.)
How can i run a mysql query and access the latest data.
The first data i may receive looks like this.
Date Watts
2022-02-08 11:00:00 1230
2022-02-08 11:15:00 1150
2022-02-08 11:30:00 1200
At a later stage, i would get 2nd data set, but with different values for the watts, but the same date range. ie
Date Watts
2022-02-08 11:00:00 1115
2022-02-08 11:15:00 900
2022-02-08 11:30:00 1500
So I want to access the last set available, and ignore any previous values saved.
Any ideas, and thanks for taking a look.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
