I am making a SQL query to the weather database, I need wind_direction and windspeed.
This is my currect request:
SELECT wind_direction,
windspeed
FROM weather
WHERE time >= curdate() and
time < (curdate() + interval 1 day) AND
windspeed > 0
ORDER BY wind_direction ASC
This will delete all values where windspeed = 0, and will only show data for today.
Request Output:
wind_direction windspeed
0 10.1
0 11.2
23 7.6
23 1.4
As you can see, I get duplicate values that are understandable, but my graphic display system does not support this, it does not know what value to use.
I need one unique wind_direction and avg () windspeed for this direction.
source
share