38 | | sub7.res_value as abondance, |
39 | | sub8.res_value as exutoire, |
| 38 | sub7.res_value as abondance |
| 39 | from |
| 40 | (select id_drain,dmer,dsource,res_value as md, the_geom from rht.rhtvs2 join rht.resultmodel on res_id_drain=id_drain where |
| 41 | res_mod_id=1) as sub1 |
| 42 | join |
| 43 | (select id_drain, res_value from rht.rhtvs2 join rht.resultmodel on res_id_drain=id_drain where |
| 44 | res_mod_id=2) as sub2 |
| 45 | on sub1.id_drain=sub2.id_drain |
| 46 | join |
| 47 | (select id_drain, res_value from rht.rhtvs2 join rht.resultmodel on res_id_drain=id_drain where |
| 48 | res_mod_id=3) as sub3 |
| 49 | on sub1.id_drain=sub3.id_drain |
| 50 | join |
| 51 | (select id_drain, res_value from rht.rhtvs2 join rht.resultmodel on res_id_drain=id_drain where |
| 52 | res_mod_id=4) as sub4 |
| 53 | on sub1.id_drain=sub4.id_drain |
| 54 | join |
| 55 | (select id_drain, res_value from rht.rhtvs2 join rht.resultmodel on res_id_drain=id_drain where |
| 56 | res_mod_id=5) as sub5 |
| 57 | on sub1.id_drain=sub5.id_drain |
| 58 | join |
| 59 | (select id_drain, res_value from rht.rhtvs2 join rht.resultmodel on res_id_drain=id_drain where |
| 60 | res_mod_id=6) as sub6 |
| 61 | on sub1.id_drain=sub6.id_drain |
| 62 | join |
| 63 | (select id_drain, res_value from rht.rhtvs2 join rht.resultmodel on res_id_drain=id_drain where |
| 64 | res_mod_id=7) as sub7 |
| 65 | on sub1.id_drain=sub7.id_drain |
| 66 | ); |
| 67 | |
| 68 | create index indextableresultmod on rht.tableresultmodel using gist(the_geom) ; |
| 69 | |
| 70 | drop table if exists rht.tableresultmodelVar; |
| 71 | create table rht.tableresultmodelVar as ( |
| 72 | select sub8.*, |
47 | | (select id_drain,dmer,dsource,res_value as md, the_geom from rht.rht_topology join rht.resultmodel on res_id_drain=id_drain where |
48 | | res_mod_id=1) as sub1 |
49 | | join |
50 | | (select id_drain, res_value from rht.rht_topology join rht.resultmodel on res_id_drain=id_drain where |
51 | | res_mod_id=2) as sub2 |
52 | | on sub1.id_drain=sub2.id_drain |
| 80 | (select id_drain,dmer,dsource,res_value as exutoire, the_geom from rht.rhtvs2 join rht.resultmodel on res_id_drain=id_drain where |
| 81 | res_mod_id=8) as sub8 |
74 | | (select id_drain, res_value from rht.rht_topology join rht.resultmodel on res_id_drain=id_drain where |
75 | | res_mod_id=8) as sub8 |
76 | | on sub1.id_drain=sub8.id_drain |
77 | | join |
78 | | (select id_drain, res_value from rht.rht_topology join rht.resultmodel on res_id_drain=id_drain where |
79 | | res_mod_id=9) as sub9 |
80 | | on sub1.id_drain=sub9.id_drain |
81 | | join |
82 | | (select id_drain, res_value from rht.rht_topology join rht.resultmodel on res_id_drain=id_drain where |
83 | | res_mod_id=10) as sub10 |
84 | | on sub1.id_drain=sub10.id_drain |
85 | | join |
86 | | (select id_drain, res_value from rht.rht_topology join rht.resultmodel on res_id_drain=id_drain where |
87 | | res_mod_id=11) as sub11 |
88 | | on sub1.id_drain=sub11.id_drain |
89 | | join |
90 | | (select id_drain, res_value from rht.rht_topology join rht.resultmodel on res_id_drain=id_drain where |
91 | | res_mod_id=12) as sub12 |
92 | | on sub1.id_drain=sub12.id_drain |
93 | | join |
94 | | (select id_drain, res_value from rht.rht_topology join rht.resultmodel on res_id_drain=id_drain where |
95 | | res_mod_id=13) as sub13 |
96 | | on sub1.id_drain=sub13.id_drain |
97 | | join |
98 | | (select id_drain, res_value from rht.rht_topology join rht.resultmodel on res_id_drain=id_drain where |
| 103 | (select id_drain, res_value from rht.rhtvs2 join rht.resultmodel on res_id_drain=id_drain where |