Mercurial > lada > lada-server
changeset 792:1cf168a038c9
Added view for reachable status values.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Wed, 18 Nov 2015 15:58:11 +0100 |
parents | 48fab56ae827 |
children | fd720cadfdb6 |
files | db_schema/lada_schema.sql |
diffstat | 1 files changed, 18 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/db_schema/lada_schema.sql Wed Nov 18 15:40:00 2015 +0100 +++ b/db_schema/lada_schema.sql Wed Nov 18 15:58:11 2015 +0100 @@ -1836,6 +1836,24 @@ latitude double precision ); +-- +-- Name status_erreichbar; Type: VIEW; Schema: stammdaten; Owner: -; +-- +CREATE VIEW status_erreichbar AS ( + SELECT DISTINCT k.wert_id, + j.wert_id AS cur_wert, + j.stufe_id AS cur_stufe + FROM stammdaten.status_kombi k + JOIN (SELECT r.zu_id, + kom.wert_id, + kom.stufe_id + FROM stammdaten.status_reihenfolge r + JOIN stammdaten.status_kombi kom + ON kom.id = r.von_id) j + ON j.zu_id = k.id +); + + SET search_path = bund, pg_catalog;