Home » RDBMS Server » Server Administration » Child to Parent
Child to Parent [message #374569] Tue, 19 June 2001 05:34 Go to next message
C.S.VENKATA SUBRAMANIAN
Messages: 2
Registered: June 2001
Junior Member
I have a table where I store all the details of the dealers.

The structure of the table is as follows

Dealer_code
Dealer_name
circle_code
dealer_type
parent_dealer

I have both child and parent records stored in the same table.
I want to trace the parent is dealer and the parent of the parent. It is easy to do the other way to find all the children of the given parent.

Can any one tell me the way out or how can this be achieved.

TIA
Venkat
Re: Child to Parent [message #374570 is a reply to message #374569] Tue, 19 June 2001 05:49 Go to previous messageGo to next message
K.SREENIVASAN
Messages: 110
Registered: January 2001
Location: banglore
Senior Member
HAI,

USE THE SELF JOIN TO FIND ALL THE CHILD OF ONE PARENT

K.SREENIVASAN
Re: Child to Parent [message #374582 is a reply to message #374569] Tue, 19 June 2001 17:00 Go to previous message
Andrew again...
Messages: 270
Registered: July 2000
Senior Member
If the structure is a tree / hierarchial structure (one to many) and NOT a network (many to many relationship) then use the connect by syntax. You can search both up and down the tree.
http://xinfo.dk/teknik/oracle/styk/hierl.htm
http://128.121.241.221/Pipelines/PLSQL/archives/orderby_connectby.txt
Previous Topic: check constraint
Next Topic: Time calculation
Goto Forum:
  


Current Time: Sat Jul 06 15:43:31 CDT 2024