feat(db): replace ORDER BY with ORDER BY DESC

This commit is contained in:
dancingCycle 2023-08-29 09:51:55 +02:00
parent 2844b401f5
commit e1a6c977f3
1 changed files with 32 additions and 32 deletions

View File

@ -114,88 +114,88 @@ CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stops_de_by_not_dhid AS SELECT stop_
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stops_de_bw_not_dhid AS SELECT stop_id,stop_name,stop_lat,stop_lon,the_geom FROM :schema.vw_gtfs_stops_de_bw_not_dhid;
---get stop names with partial Global ID availability
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_bb_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_bb GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_bb_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_bb GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_bb_part_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_bb_part_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_be_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_be GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_be_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_be GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_be_part_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_be_part_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_bw_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_bw GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_bw_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_bw GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_bw_part_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_bw_part_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_by_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_by GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_by_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_by GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_by_part_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_by_part_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_hb_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_hb GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_hb_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_hb GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_hb_part_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_hb_part_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_he_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_he GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_he_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_he GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_he_part_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_he_part_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_hh_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_hh GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_hh_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_hh GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_hh_part_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_hh_part_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_mv_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_mv GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_mv_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_mv GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_mv_part_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_mv_part_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_ni_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_ni GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_ni_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_ni GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_ni_part_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_ni_part_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_nw_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_nw GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_nw_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_nw GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_nw_part_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_nw_part_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_rp_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_rp GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_rp_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_rp GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_rp_part_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_rp_part_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_sh_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_sh GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_sh_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_sh GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_sh_part_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_sh_part_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_sl_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_sl GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_sl_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_sl GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_sl_part_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_sl_part_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_sn_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_sn GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_sn_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_sn GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_sn_part_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_sn_part_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_st_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_st GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_st_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_st GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_st_part_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_st_part_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_th_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_th GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_th_part_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_th GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id != count_dhid AND count_id != count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_th_part_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_th_part_dhid;
---get stop names with no Global ID availability
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_bb_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_bb GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id = count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_bb_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_bb GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id = count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_bb_no_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_bb_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_be_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_be GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id = count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_be_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_be GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id = count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_be_no_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_be_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_bw_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_bw GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id = count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_bw_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_bw GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id = count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_bw_no_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_bw_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_by_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_by GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id = count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_by_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_by GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id = count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_by_no_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_by_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_hb_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_hb GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id = count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_hb_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_hb GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id = count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_hb_no_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_hb_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_he_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_he GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id = count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_he_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_he GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id = count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_he_no_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_he_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_hh_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_hh GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id = count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_hh_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_hh GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id = count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_hh_no_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_hh_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_mv_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_mv GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id = count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_mv_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_mv GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id = count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_mv_no_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_mv_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_ni_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_ni GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id = count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_ni_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_ni GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id = count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_ni_no_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_ni_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_nw_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_nw GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id = count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_nw_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_nw GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id = count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_nw_no_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_nw_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_rp_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_rp GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id = count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_rp_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_rp GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id = count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_rp_no_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_rp_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_sh_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_sh GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id = count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_sh_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_sh GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id = count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_sh_no_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_sh_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_sl_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_sl GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id = count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_sl_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_sl GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id = count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_sl_no_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_sl_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_sn_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_sn GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id = count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_sn_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_sn GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id = count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_sn_no_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_sn_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_st_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_st GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id = count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_st_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_st GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id = count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_st_no_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_st_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_th_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_th GROUP BY stop_name ORDER BY count_id) AS foo WHERE count_id = count_no_dhid;
CREATE OR REPLACE VIEW :schema.vw_gtfs_stop_names_de_th_no_dhid AS SELECT * FROM (SELECT count(stop_id) AS count_id, count(stop_id) filter (WHERE stop_id NOT LIKE '%:%:%') AS count_no_dhid, count(stop_id) filter (WHERE stop_id LIKE '%:%:%') AS count_dhid, stop_name FROM :schema.tbl_gtfs_stops_de_th GROUP BY stop_name ORDER BY count_id DESC) AS foo WHERE count_id = count_no_dhid;
CREATE TABLE IF NOT EXISTS :schema.tbl_gtfs_stop_names_de_th_no_dhid AS SELECT * FROM :schema.vw_gtfs_stop_names_de_th_no_dhid;