Riku Räsänen schrieb:Depends on the criteria, which subtrees you like to retain. For example, if you wish to reject all except under the first parent_id (first in sense of ordered by parent_id), you could do something like
SELECT LPAD (' ', (LEVEL - 1) * 2) || TO_CHAR (id, '999') id , parent_id FROM (select id,min(parent_id) parent_id from tree_hierarchy group by id) START WITH id = 1 CONNECT BY PRIOR id = parent_id Best regards Maxim -- //www.freelists.org/webpage/oracle-l