Have a look at this similar question on Stackoverflow, just remove the group_id.
After running the repeated updates SELECT * FROM vt_tmp should return your expected result.
Hi dnoeth, thank you i will check that.
do you know if there is a way to avoid to repeat updates, or at least how can i run the update automatically until no more is necessary(without procedure or BTEQ)
Without SP or BTEQ the only solution would be WITH RECURSIVE, but this is way more complicated and might run out of spool.