# HG changeset patch # User Tom Gottfried # Date 1369323165 -7200 # Node ID a0dbc60f78ee151857e261bc320a57daed53503f # Parent 176664f84d865e0eaac7ba5e75e118ad83b739b2# Parent c7777feea223175aa9a8dcb0deaed3e85c241f59 merged diff -r c7777feea223 -r a0dbc60f78ee backend/doc/schema/oracle.sql --- a/backend/doc/schema/oracle.sql Thu May 23 17:31:26 2013 +0200 +++ b/backend/doc/schema/oracle.sql Thu May 23 17:32:45 2013 +0200 @@ -414,25 +414,25 @@ -- VIEWS CREATE VIEW wst_value_table AS - SELECT wcv.position AS position, - w, - (SELECT q - FROM wst_column_q_ranges wcqr - JOIN wst_q_ranges wqr - ON wcqr.wst_q_range_id = wqr.id - JOIN ranges r - ON r.id = wqr.range_id - WHERE wcqr.wst_column_id = wc.id - AND wcv.position BETWEEN r.a AND r.b) AS q, - wc.position AS column_pos, - w.id AS wst_id - FROM wst_column_values wcv - JOIN wst_columns wc - ON wcv.wst_column_id = wc.id - JOIN wsts w - ON wc.wst_id = w.id + SELECT + wcv.position AS position, + w, + q, + wc.position AS column_pos, + w.id AS wst_id + FROM wsts w + JOIN wst_columns wc + ON wc.wst_id=w.id + JOIN wst_column_q_ranges wcqr + ON wcqr.wst_column_id=wc.id + JOIN wst_q_ranges wqr + ON wcqr.wst_q_range_id=wqr.id + JOIN ranges r + ON wqr.range_id=r.id + JOIN wst_column_values wcv + ON wcv.wst_column_id=wc.id AND wcv.position between r.a and r.b; ORDER BY wcv.position ASC, - wc.position DESC; + wc.position DESC; -- view to select the w values of a WST CREATE VIEW wst_w_values AS diff -r c7777feea223 -r a0dbc60f78ee backend/doc/schema/postgresql.sql --- a/backend/doc/schema/postgresql.sql Thu May 23 17:31:26 2013 +0200 +++ b/backend/doc/schema/postgresql.sql Thu May 23 17:32:45 2013 +0200 @@ -243,25 +243,25 @@ ); CREATE VIEW wst_value_table AS - SELECT wcv.position AS position, - w, - (SELECT q - FROM wst_column_q_ranges wcqr - JOIN wst_q_ranges wqr - ON wcqr.wst_q_range_id = wqr.id - JOIN ranges r - ON r.id = wqr.range_id - WHERE wcqr.wst_column_id = wc.id - AND wcv.position BETWEEN r.a AND r.b) AS q, - wc.position AS column_pos, - w.id AS wst_id - FROM wst_column_values wcv - JOIN wst_columns wc - ON wcv.wst_column_id = wc.id - JOIN wsts w - ON wc.wst_id = w.id + SELECT + wcv.position AS position, + w, + q, + wc.position AS column_pos, + w.id AS wst_id + FROM wsts w + JOIN wst_columns wc + ON wc.wst_id=w.id + JOIN wst_column_q_ranges wcqr + ON wcqr.wst_column_id=wc.id + JOIN wst_q_ranges wqr + ON wcqr.wst_q_range_id=wqr.id + JOIN ranges r + ON wqr.range_id=r.id + JOIN wst_column_values wcv + ON wcv.wst_column_id=wc.id AND wcv.position between r.a and r.b; ORDER BY wcv.position ASC, - wc.position DESC; + wc.position DESC; -- view to select the w values of a WST CREATE VIEW wst_w_values AS