there are several multi-statement solutions out there to move a subtree to a new location (possibly inside another parent node), but I couln't find a solution on the Web to achieve this with a single update statement.
Well, here it is:
Code:
-- moves a subtree before the specified position
-- if the position is the rgt of a node, the subtree will be its last child
-- if the position is the lft of a node, the subtree will be inserted