diff db_schema/stammdaten_schema.sql @ 882:2e9007297e78

merged
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 12 Feb 2016 12:10:09 +0100
parents 6bd149c352a9
children fa7278bd8d73
line wrap: on
line diff
--- a/db_schema/stammdaten_schema.sql	Thu Feb 11 17:07:14 2016 +0100
+++ b/db_schema/stammdaten_schema.sql	Fri Feb 12 12:10:09 2016 +0100
@@ -725,17 +725,16 @@
 
 
 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
+    SELECT r.id,
+           zu.wert_id,
+           zu.stufe_id,
+           von.wert_id AS cur_wert,
+           von.stufe_id AS cur_stufe
+    FROM stammdaten.status_reihenfolge r
+        JOIN stammdaten.status_kombi von
+            ON von.id = r.von_id
+        JOIN stammdaten.status_kombi zu
+            ON zu.id = r.zu_id
 );
 -- Status workflow
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)