Oracle SQL Hierarchical query bottom to top -
i have ids of leafs. need select id in hierarchy. i'm using following query:
select distinct id table start id in (ids_of_leafs) connect id = prior pid but maybe can done way without distinct , traversal full hierarchy?
no, not possible without additional stuff adding custom index value every row , calculate mathematically things select. not native , heavy solution. cannot replace query if not know height of tree, , need manually write amount of select statements equals height of tree.
if have problems performance, create indices or materialized view collect parents every leave.
Comments
Post a Comment