How to get all the parents of a given node from a tree in single row?
HI,
I have a requirement to get the all the parent nodes till the root, of all the leaf nodes in a Tree structure in a single row instead of multiple rows.
Normally we can get the tree structure as follows for a leaf level node_id : 1023.
select node_id,node_name,node_level,parent_node_id
from tree
start with node_id=1023
connect by prior parent_node_id=node_id
This query returns all the parents of the leaf nodes, but in multiple rows as follows
Bookmarks