postgresql7.1
select substring(tree_sortkey, 0, 9) as father_tree_sortkey
from forums_messages
where message_id=$message(message_id)
select parent_id
from forums_messages
where forum_id = $message(forum_id) and tree_sortkey between tree_left('$father_tree_sortkey') and tree_right('$father_tree_sortkey')
order by tree_sortkey desc