| 214 | |
| 215 | |
| 216 | /------Requête effectuée avec Cédric le 7/10/2011 |
| 217 | select distinct on (id_bdcarth,id_drain) id_bdcarth, min(distance) as distance, id_drain from ( |
| 218 | select r.id_drain, |
| 219 | id_bdcarth, |
| 220 | ST_Distance(r.the_geom,bdc.the_geom) as distance |
| 221 | from (select * from rht.rht where id_drain in('309179','309116','309047','309048')) as r join rht.rht_150 rht150 on r.id_drain=rht150.id_drain |
| 222 | join bd_carthage2011.troncon_hydrographique bdc on st_intersects(bdc.the_geom,rht150.the_geom) |
| 223 | where nature !='Aqueduc, conduite forcée' and num_superp !=1 ) as toto |
| 224 | group by id_bdcarth, distance, id_drain |
| 225 | order by id_bdcarth ; ---393393 lines |