Created
June 23, 2014 20:51
-
-
Save luqmaan/b9982f075da3c43f2e71 to your computer and use it in GitHub Desktop.
Get the routes nearby whole foods, note the location comparison part is total garbage
This file contains hidden or 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
SELECT * FROM trips, | |
( | |
SELECT * FROM stop_times, | |
( | |
SELECT * FROM stops | |
WHERE stop_lat > 30.260650 AND stop_lat < 30.280650 | |
AND stop_lon < -97.743562 AND stop_lon > -97.763562 | |
) as nearby_stops | |
WHERE stop_times.stop_id = nearby_stops.stop_id | |
GROUP BY trip_id | |
) as nearby_trips | |
WHERE trips.trip_id = nearby_trips.trip_id | |
GROUP BY route_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment