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: "un-grouping" results

Re: "un-grouping" results

From: <mikharakiri_nospaum_at_yahoo.com>
Date: 8 Feb 2005 14:51:20 -0800
Message-ID: <1107903080.200290.202250@f14g2000cwb.googlegroups.com>


Correct.

Here is an explanation. The result set of hierarchical query is a union of 2 sets:
1. Initial seed specified by "start with" clause, and 2. The set of tuples derived by transitive closure with "connect by" clause.
Predicate in the "connect by" clause can empty only the second set.

An alternative syntax would allow "prior" keyword in the where clause without the need in either "start with" or "connect by". The standard hierarchical query in this syntax would look like this

select sys_connect_by_path(ename)
from emp
where (prior empno = mgr or name = 'KING')

Here the fact that the result is a union of 2 sets is explicit.

This syntax is reminicent of DB2's resursive "with". (With the major omission in ability to create calculated columns). Received on Tue Feb 08 2005 - 16:51:20 CST

Original text of this message

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