comparison flys-backend/doc/schema/postgresql.sql @ 755:a29fd0916803

Added a new view to select qs of a WST. flys-backend/trunk@1988 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 24 May 2011 11:12:59 +0000
parents 5bcf338eadb9
children bf16268629d9
comparison
equal deleted inserted replaced
754:5bcf338eadb9 755:a29fd0916803
226 FROM wst_column_values wcv 226 FROM wst_column_values wcv
227 JOIN wst_columns wc ON wcv.wst_column_id = wc.id 227 JOIN wst_columns wc ON wcv.wst_column_id = wc.id
228 JOIN wsts w ON wc.wst_id = w.id 228 JOIN wsts w ON wc.wst_id = w.id
229 ORDER BY wcv."position", wc."position"; 229 ORDER BY wcv."position", wc."position";
230 230
231 -- view to select the q values of a WST
232 CREATE VIEW wst_q_values AS
233 SELECT wc.position AS column_pos,
234 wqr.q AS q,
235 r.a AS a,
236 r.b AS b,
237 wc.wst_id AS wst_id
238 FROM wst_column_q_ranges wcqr
239 JOIN wst_q_ranges wqr ON wcqr.wst_q_range_id = wqr.id
240 JOIN ranges r ON wqr.range_id = r.id
241 JOIN wst_columns wc ON wcqr.wst_column_id = wc.id
242 ORDER BY wc.position, wcqr.wst_column_id, r.a;
243
231 COMMIT; 244 COMMIT;

http://dive4elements.wald.intevation.org