feat: adjust sql/join-rts-srvcs-trps-pdts.sql and sql/join-rts-srvcs-trps.sql
This commit is contained in:
parent
92b0171e81
commit
233b95a947
|
@ -5,6 +5,6 @@ CREATE SCHEMA IF NOT EXISTS :schema_gtfsr;
|
|||
SET search_path to :schema, :schema_gtfsr, public;
|
||||
|
||||
---create view
|
||||
DROP VIEW IF EXISTS :schema.vw_join_rts_trps_srvcs_pdts;
|
||||
CREATE OR REPLACE VIEW :schema.vw_join_rts_trps_srvcs_pdts AS
|
||||
|
||||
SELECT rts.route_id, rts.route_short_name, rts.route_long_name, trps.service_id, trps.trip_id, trps.trip_short_name, trps.trip_headsign, srvcs.dates, pdts.timestamp_pgsql FROM :schema.trips AS trps LEFT JOIN :schema.routes AS rts ON trps.route_id = rts.route_id LEFT JOIN :schema.services AS srvcs ON trps.service_id = srvcs.service_id LEFT JOIN :schema_gtfsr.trip_updates AS pdts ON trps.route_id = pdts.trip_route_id AND trps.trip_id = pdts.trip_trip_id ORDER BY rts.route_id, trps.trip_id;
|
||||
|
|
|
@ -4,6 +4,6 @@ CREATE SCHEMA IF NOT EXISTS :schema;
|
|||
SET search_path to :schema, public;
|
||||
|
||||
---create view
|
||||
DROP VIEW IF EXISTS :schema.vw_join_rts_trps_srvcs;
|
||||
CREATE OR REPLACE VIEW :schema.vw_join_rts_trps_srvcs AS
|
||||
|
||||
SELECT rts.route_id, rts.route_short_name, rts.route_long_name, trps.service_id, trps.trip_id, trps.trip_short_name, trps.trip_headsign, srvcs.dates FROM :schema.trips AS trps LEFT JOIN :schema.routes AS rts ON trps.route_id = rts.route_id LEFT JOIN :schema.services AS srvcs ON trps.service_id = srvcs.service_id ORDER BY rts.route_id, trps.trip_id;
|
||||
|
|
Loading…
Reference in New Issue