postgresql7.1 parent_id in (select children.item_id from cr_items parent, cr_items children where parent.item_id = :folder_id and children.content_type = 'content_folder' and children.tree_sortkey between parent.tree_sortkey and tree_right(parent.tree_sortkey))