Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Hierachical SELECT.
This is just a self-join.
select grunt.*, boss.* from emp grunt, emp boss where grunt.ename = 'Scott' and bos.empno = grunt.mgr;
It gets difficult only when you want multiple levels.
It gets mean when the number of levels is unknown in advance and/or varies.
Rose Noel wrote:
> Hello everybody,
> I am trying to select some employee data from emp table without using
> the "CONNECT BY CLAUSE". Is it this possible using only SQL.
> Empno Ename Mgr
> 7765 Scott 7788
> 7788 Jones 7839
>
> This is the result of executing the query. I know Scott's EMPNO and I
> want his details and that of his manager. How can this be done in sql
> Cheers
> RNK.
Received on Wed Jun 02 1999 - 22:54:20 CDT
![]() |
![]() |