Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: "un-grouping" results
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