Created
October 6, 2015 15:00
-
-
Save ijokarumawak/74783245aa21005d39e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// r.airlineidでJOIN | |
SELECT META(r).id as rid, META(a).id as aid, a.name, r.equipment, s.flight, s.utc | |
FROM `travel-sample` r | |
UNNEST r.schedule AS s | |
JOIN `travel-sample` a ON KEYS r.airlineid | |
WHERE r.sourceairport = "SFO" | |
AND r.destinationairport = "LAX" | |
ORDER BY rid ASC, s.utc ASC | |
LIMIT 2; | |
// 結果 | |
[{ | |
"aid": "airline_2009", | |
"equipment": "E75", | |
"flight": "DL388", | |
"name": "Delta Air Lines", | |
"rid": "route_21755", | |
"utc": "00:14:00" | |
}, | |
{ | |
"aid": "airline_2009", | |
"equipment": "E75", | |
"flight": "DL877", | |
"name": "Delta Air Lines", | |
"rid": "route_21755", | |
"utc": "01:33:00" | |
}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment