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: hierarchical query - returning a treewalked subset

Re: hierarchical query - returning a treewalked subset

From: SpaceMarine <spacemarine_at_mailinator.com>
Date: Thu, 08 Nov 2007 12:02:45 -0800
Message-ID: <1194552165.266608.270280@e9g2000prf.googlegroups.com>


On Nov 8, 5:01 am, havardk <hrkristiansen..._at_hotmail.com> wrote:
> "Start with" which returns more than one row works fine.
>
> The example below is slow, but working :-)
>
> select level, emp.*
> from employees emp
> start with emp.employee_id in (select emp2.employee_id
> from employees emp2
> where emp2.first_name like 'Kevin%')
> connect by prior emp.employee_id = emp.manager_id

...in my queries, this returns identical results as my example, but is a bit slower, probably due to the nested select.

both suffer from another problem that ive just posted on -- duplicate rows; one row belonging to its proper level (if the row is assigned as a child), the other always being duplicated as a LEVEL 1.

sm Received on Thu Nov 08 2007 - 14:02:45 CST

Original text of this message

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