Re: GetHierarchy - Mailing list pgadmin-support

From bhanu udaya
Subject Re: GetHierarchy
Date
Msg-id COL002-W71D7AC2CA77B96E97DCC1D3FF0@phx.gbl
Whole thread Raw
Responses Re: GetHierarchy  (Craig Ringer <craig@2ndquadrant.com>)
List pgadmin-support
Greetings !

I have a hierarchy table with two attributes :  Parent_ID, Child_ID with the sample data (can go upto n-level) as below:

ParentIDChildID
13
14
35
56
67


I need a query to retrieve all the n level hierarchy when a Child node_id is passed. For example; if I pass 7, then i need parent nodes as below: I want to achive this in postgres database (version 9.2) without connect by prior.

ParentID ChildID
3               5
5              6
6             7

Any reply on this is great help.

Thanks and REgards
RAdha Krishna



pgadmin-support by date:

Previous
From: Guillaume Lelarge
Date:
Subject: Re: pgadmin3 1.6.1, role editing bug
Next
From: Craig Ringer
Date:
Subject: Re: GetHierarchy