| 56 | }}} |
| 57 | |
| 58 | == Nextdownid == |
| 59 | {{{ |
| 60 | #!sql |
| 61 | create table rht.fromnodetonodevs2 as (select taval.id_drain as id_drainaval, tamont.id_drain as id_drainamont from rht.rhtvs2 tamont join rht.rhtvs2 taval on tamont.tnode=taval.fnode); |
| 62 | alter table rht.rhtvs2 add column nextdownid integer; |
| 63 | update rht.rhtvs2 SET nextdownid=id_drainaval from rht.fromnodetonodevs2 ft where id_drain=ft.id_drainamont; |
| 64 | |
| 65 | |
| 66 | -- correction d'un problème par Cédric |
| 67 | select * from rht.rhtvs2 where id_drain=nextdownid |
| 68 | update rht.rhtvs2 set nextdownid=-9999 where id_drain=nextdownid --505 |