Re: Modelling hierarchy in the relational database

From: Steve Long <slong3_at_mediaone.net>
Date: Fri, 17 Aug 2001 21:08:29 GMT
Message-ID: <hJff7.2130$L8.25154_at_typhoon.jacksonville.mediaone.net>


if you are using Oracle, yes. oracle has provided a non-standard solution. look up the "connect by" clause. it supports hierarchical traversal. however, if you are using a platform other than oracle, you may have to use some other method or function. you can always use procedural code to do a traversal. it just depends on how portable the SQL needs to be.

"abracad" <abracad_at_nospam.com> wrote in message news:3b7d87c0.509669_at_news.freeserve.net...
> I am constructing a database to model hierarchy, e.g.
> A
> |
 B
> |
> C
>
> I envisage a table parent consisiting fields parent, child and would
> store records A,B and B,C. Would I also need to store record A,C?
>
> I.e. can SQL act recursively to determina all the children of a given
> node (could it retrieve B and C if I queried for the children of A
> with only records A,B and B,C stored?)
>
> Many thanks in advance for any help on this
Received on Fri Aug 17 2001 - 23:08:29 CEST

Original text of this message