comparison flys-backend/doc/schema/postgresql.sql @ 4651:83a42e6a562d

Added view for selecting ranges in wsts.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 06 Dec 2012 17:30:09 +0100
parents 948c7289fc42
children 20b6ebf23916
comparison
equal deleted inserted replaced
4650:31327b3b2455 4651:83a42e6a562d
411 FROM official_lines ol 411 FROM official_lines ol
412 JOIN q_main_values qmv 412 JOIN q_main_values qmv
413 ON ol.river_id = qmv.river_id 413 ON ol.river_id = qmv.river_id
414 AND ol.name = qmv.name; 414 AND ol.name = qmv.name;
415 415
416 CREATE VIEW wst_ranges
417 AS
418 SELECT wc.id AS wst_column_id,
419 wc.wst_id AS wst_id,
420 Min(wcv.position) AS a,
421 Max(wcv.position) AS b
422 FROM wst_columns wc
423 JOIN wst_column_values wcv
424 ON wc.id = wcv.wst_column_id
425 GROUP BY wc.id,
426 wc.wst_id;
427
416 COMMIT; 428 COMMIT;

http://dive4elements.wald.intevation.org