Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Query Treewalk Teaser

Re: SQL Query Treewalk Teaser

From: Ban Spam <ban-spam_at_operamail.com>
Date: Tue, 30 Apr 2002 01:22:19 GMT
Message-ID: <Xns91FFBAE459C8DSunnySD@68.6.19.6>


"Mike Cretan" <mcretan_at_ozemail.com.au> wrote in news:JS4z8.36$HM.31016_at_vicpull1.telstra.net:

> Hi Folks,
>
> DB 8.1.7 on NT
>
> I'm no newbie, but I'm having some issues figuring out which way to go
> about this one, and I'd appreciate some help...
>
> I have a table structure as follows:
>
> .---------.
> | Identity |
> '---------'
> | |
> n n
> .--------------.
> | Relationship |
> '--------------'
>
> i.e an identity can be related to many other identities, which can in
> turn be related to many other identities.
>
> The relationship is not strictly hierarchical like the old emp manager
> example.
>
> What I would like to get is the entire set of identities that have any
> relationships given a starting identity?
>
> With Oracle, how can I tree walk the entire set of relationships and
> list the identities. I don't care about the level, just the related
> identities.
>
> Many thanks in advance,
>
> Mike Cretan
>
>
>
>
>
>

This sounds like you might be able to make use of a recursive descent algorithm; similar to one which traverses a B-tree. Received on Mon Apr 29 2002 - 20:22:19 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US