Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: hierarchical query - returning a treewalked subset
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
![]() |
![]() |