Answer by Pranav Sri for Hierarchical queries in Oracle
It will give you the exact result you want:select connect_by_root(id) as root, id, parent_idfrom test1connect by prior id=parent_idstart with parent_id is not null;
View ArticleAnswer by Allan for Hierarchical queries in Oracle
The query you posted is missing the from clause and left an underscore out of connect_by_root, but I'll assume those aren't actually the source of your problem.The following query gives you the result...
View ArticleAnswer by A.B.Cade for Hierarchical queries in Oracle
try this: select connect_by_root(id) root_id, id, parent_idfrom your_tablestart with parent_id is nullconnect by prior id = parent_id
View ArticleHierarchical queries in Oracle
I have a table with a structure like (id, parent_id) in Oracle11g.id parent_id---------------1 (null)2 (null)3 14 35 36 27 2I'd like to query it to get all the lines that are hierarchically linked to...
View Article
More Pages to Explore .....