| 110 | |
| 111 | drop table if exists rht.tableresultmodel2; |
| 112 | create table rht.tableresultmodel as ( |
| 113 | select sub1.*, |
| 114 | sub2.res_value as mpa, |
| 115 | sub3.res_value as mdmpa, |
| 116 | sub4.res_value as abondance |
| 117 | from |
| 118 | (select id_drain,dmer,dsource,res_value as md, the_geom from rht.rhtvs2 join rht.resultmodel on res_id_drain=id_drain where |
| 119 | res_mod_id=15) as sub1 |
| 120 | join |
| 121 | (select id_drain, res_value from rht.rhtvs2 join rht.resultmodel on res_id_drain=id_drain where |
| 122 | res_mod_id=16) as sub2 |
| 123 | on sub1.id_drain=sub2.id_drain |
| 124 | join |
| 125 | (select id_drain, res_value from rht.rhtvs2 join rht.resultmodel on res_id_drain=id_drain where |
| 126 | res_mod_id=17) as sub3 |
| 127 | on sub1.id_drain=sub3.id_drain |
| 128 | join |
| 129 | (select id_drain, res_value from rht.rhtvs2 join rht.resultmodel on res_id_drain=id_drain where |
| 130 | res_mod_id=18) as sub4 |
| 131 | on sub1.id_drain=sub4.id_drain |
| 132 | ); |