# HG changeset patch # User Raimund Renkert # Date 1403274789 -7200 # Node ID 598e4bec920b2a216c7388d99fffefbbe59692de # Parent 8e320b5933dea471672ff2c2624a0fbedb8cdcd1 New macros for bed height differneces. diff -r 8e320b5933de -r 598e4bec920b artifacts/doc/conf/meta-data.xml --- a/artifacts/doc/conf/meta-data.xml Fri Jun 20 13:45:54 2014 +0200 +++ b/artifacts/doc/conf/meta-data.xml Fri Jun 20 16:33:09 2014 +0200 @@ -132,6 +132,9 @@ Non Rec out iteration for: {$out} + + + @@ -1718,6 +1721,104 @@ + + blablub + + + + WITH sta + AS (SELECT bhs.id, + bhs.description, + bhsv.station, + bhs.year + FROM bed_height_single bhs + JOIN bed_height_single_values bhsv + ON bhsv.bed_height_single_id = bhs.id + WHERE bhs.river_id = ${river_id} + AND bhs.year BETWEEN ${year_from} AND ${year_to}), + csta + AS (SELECT b1.id AS id1, + b1.description AS b1desc, + b1.year AS b1year, + b2.id AS id2, + b2.description AS b2desv, + b2.year AS b2year + FROM sta b1 + JOIN sta b2 + ON b1.station = b2.station + AND b1.id < b2.id) + SELECT id1, b1desc, b1year, + id2, b2desc, b2year + FROM csta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TODO: We need to group for year1 and year2 + + + TODO: Better structure + + A - B + + + + B - A + + + + + + + TODO: Better structure + + A - B + + + + B - A + + + + + +