Created
May 6, 2013 13:02
-
-
Save elmariachi111/5524959 to your computer and use it in GitHub Desktop.
An SQL query that JOINs GTFS relational data into something more friendly for JSON transformation
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
USE hack_test; | |
SELECT DISTINCT | |
s.stop_id, s.stop_sequence, s.pickup_type, s.drop_off_type, t.route_id, | |
t.trip_headsign, r.route_short_name,r.agency_id, st.stop_name, | |
st.stop_lat, st.stop_lon | |
FROM stop_times s LEFT JOIN trips t ON s.trip_id = t.trip_id | |
LEFT JOIN routes r ON t.route_id = r.route_id | |
LEFT JOIN stops st ON s.stop_id = st.stop_id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment