Hi people,
 
    I have this table X,  whose structure is described below:
 
Name                                Null?    Type
-------------------------------------- -------- ------------------------
NAME                                          VARCHAR2(20)
EMP                                             NUMBER(5)
BOSS                                           NUMBER(5)
 
The table is having the following data:
 

NAME                                   EMP    BOSS
------------------------------------------ ----------- ----------
SAMAR                                  10         20
ASHOK                                  20         30
ASHWINI                                30         40
MONIKA                                 11         21
RASHI                                    21         31
SMRITI                                   12         22
SUMEET                                22         32
 
The table is storing the employee and its boss relationship
in a hierarchical format. eg. employee 10's boss is 20.
employee 20's boss is 30 and 30's boss is 40.
 
Now my question is that I want to select all the records from
the table where the employee no. returned doesn't have any
hierarchical relationship with the employee no. passed in the
where condition of the query.
for eg. if
           
select ....
from X
where ......
and emp = 10;
 
then I don't want the following records :
 
SAMAR                     10         20
ASHOK                     20         30
ASHWINI                   30         40
 
But want all the following records:
 
MONIKA                    11         21
RASHI                       21         31
SMRITI                      12         22
SUMEET                   22         32
 
Awaiting help.....
 
 
thanks,
 
 
Samar
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

--------------------------------------------------------------------------------------------------------
CONFIDENTIALITY/PROPRIETARY NOTE
 
This communication is confidential / proprietary and is intended for use only by
the addressee. IGT Solutions Private Limited accepts no responsibility for any
mistransmission of,or interference with, this communication.
--------------------------------------------------------------------------------------------------------

Reply via email to