api.sql (1008B)
1 ; humidity data 2 3 SELECT DISTINCT temperature, dew_point, nl.name as city, date_time 4 FROM weather_data wd 5 JOIN station s ON wd.station_name = s.name 6 JOIN contract_station cs ON cs.station_name = s.name 7 JOIN nearestlocation nl ON nl.station_name = s.name 8 JOIN country co ON co.country_code = nl.country_code 9 JOIN geolocation geo ON geo.country_code = co.country_code 10 JOIN contract c ON cs.contract_id = c.contract_id 11 WHERE c.token = ? 12 ORDER BY date_time DESC 13 14 ; h data 15 16 SELECT distinct temperature, wind_speed, dew_point, DATE(date_time) AS date, nl.name as city 17 FROM weather_data wd 18 JOIN station s ON wd.station_name = s.name 19 JOIN contract_station cs ON cs.station_name = s.name 20 JOIN nearestlocation nl ON nl.station_name = s.name 21 JOIN country co ON co.country_code = nl.country_code 22 JOIN geolocation geo ON geo.country_code = co.country_code 23 JOIN contract c ON cs.contract_id = c.contract_id 24 WHERE c.token = ? 25 ORDER BY date DESC, temperature, wind_speed 26