Recently I found an Oracle extension, START WITH .. CONNECT BY, which
greatly eases parsing of n-way tree structures stored in table format.
I'd prefer implementing this myself, but alas, I feel I need something
which is a bit easier, to get accustomed to the code base.
the following is copyrighted by Oracle Corporation. So, sue me for posting
it. :)
START WITH condition
Specify a condition that identifies the row(s) to be used as the
root(s) of a hierarchical query. Oracle uses as root(s) all rows that
satisfy this condition. If you omit this clause, Oracle uses all rows in
the table as root rows. The START WITH condition can contain a subquery.
CONNECT BY condition
Specify a condition that identifies the relationship between parent rows
and child rows of the hierarchy. condition can be any condition as
described in "Conditions". However, some part of the condition must use
the PRIOR operator to refer to the parent row. The part of the condition
containing the PRIOR operator must have one of the following forms:
PRIOR expr comparison_operator expr
expr comparison_operator PRIOR expr
Restriction: The CONNECT BY condition cannot contain a subquery.
Ola
--
Ola Sundell
ola@miranda.org - olas@wiw.org - ola.sundell@personalchemistry.com
http://miranda.org/~ola