Mercurial > lada > lada-server
diff db_schema/lada_schema.sql @ 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 | f2ae2d734b80 |
children | e15c981fe310 |
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;