with T1 as
( select tree.* from tree where parent_id = 2
union all
select tree.* from tree
join T1 on (tree.parent_id=T1.id)
)
select * from T1
This query selects all children nodes in a hierarchical tree.
What I need to do is, with all the results returned from the query above, is update a field called [level] by an increment of 1.
I have tried myself with a few permutations but I get errors about not being able to update a derived table