Combining two queries in Yahoo YQL

I want to get weather information in a specific place.

Right now I need to call to get them: the first one transferred my current position (lat / lon) to WOEID, the second call gets weather information using this WOEID.

Is it possible to combine these 2 queries?

First: select * from yahoo.maps.findLocation where q = "LAT, LON" and gflags = "R"

Second: select * from weather.bylocation, where location = WOEID AND unit = 'c'

+4
source share
1 answer

You can use sub-selects to combine data between different queries.

In your case, you can grab the woeid from the yahoo.maps.findLocation table and paste this into the query in the weather.bylocation table as follows:

 select * from weather.bylocation where unit = 'c' and location in ( select Results.woeid from yahoo.maps.findLocation where q="LAT, LON" and gflags="R" limit 1 ) 
+3
source

Source: https://habr.com/ru/post/1315323/


All Articles