Created
February 8, 2017 11:28
-
-
Save plesner/658aa7114641315a80c3e9a5e10ecff1 to your computer and use it in GitHub Desktop.
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 | |
stops.stop_name | |
, stop_times.departure_time_secs / 3600 AS departure_time_hours | |
, (stop_times.departure_time_secs / 60) - ((stop_times.departure_time_secs / 3600) * 60) AS departure_time_mins | |
, trips.trip_headsign | |
, routes.route_short_name | |
, calendars.monday | |
, calendars.tuesday | |
, calendars.wednesday | |
, calendars.thursday | |
, calendars.friday | |
, calendars.saturday | |
, calendars.sunday | |
FROM stops | |
JOIN stop_times ON stop_times.stop_id = stops.id | |
JOIN trips ON trips.id = stop_times.trip_id | |
JOIN routes ON routes.id = trips.route_id | |
JOIN calendars ON calendars.service_id = trips.service_id | |
WHERE | |
stops.stop_id LIKE '%38587' | |
AND calendars.wednesday = 1 | |
ORDER BY stop_times.departure_time_secs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment