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: SQL Hierachical SELECT.

Re: SQL Hierachical SELECT.

From: John Higgins <JH33378_at_deere.com>
Date: Wed, 02 Jun 1999 22:54:20 -0500
Message-ID: <3755FC6C.DA36C92F@deere.com>


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

Original text of this message

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