All pastes #500072 Raw Edit

google transit

public sql v1 · immutable
·published 2007-05-21 12:46 UTC
rendered paste body
SELECT * FROM trips AS t   INNER JOIN calendar AS c     ON t.service_id=c.service_id   INNER JOIN calendar_dates AS cd     ON t.service_id=cd.service_id  WHERE     AND cd.date=:date     AND cd.exceptType=1    AND (c.start IS NULL OR c.start<=:date)    AND (c.end IS NULL OR c.end>=:date)    AND (c.days=0 OR (c.days & :day) != 0);