Get data in a child parent relationship
Get data in a child parent relationship
(OP)
Hi all,
I currently have a table with data in this format:
What I want now is a view to get the data in a child -parent relationship thus:
Any ideas please...
Thanks.
I currently have a table with data in this format:
CODE --> sql
prd_id | prd_dsc | mdl_dsc ---------------------------------------------------------- 001 | Regular Portfolio | Equities 001-CF-000001 | Fixed Income Fund | Funds 0002 | Managed Portfolio | Equities 001-NF-000374 | Ivory Fund | Funds B1 | 90 Day Treasury Bills | Bills
CODE --> sql
id | p_id | label ---------------------------- 1 | null | Equities 2 | null | Funds 3 | null | Bills 4 | 1 | Regular Portfolio 5 | 2 | Fixed Income Fund 6 | 1 | Managed Portfolio 7 | 2 | Ivory Fund 8 | 3 | 90 Day Treasury Bills
Thanks.
RE: Get data in a child parent relationship
Have fun.
---- Andy
RE: Get data in a child parent relationship
RE: Get data in a child parent relationship
In order to understand recursion, you must first understand recursion.
RE: Get data in a child parent relationship
CODE
Now, using Oracle's unique CONNECT BY...START WITH hierarchical tree-walking code, here is the employee-manager org chart for the data, above:
CODE
Let us know if you have additional questions about Oracle's hierarchical tree walking.
(aka Dave of Sandy, Utah, USA)
“People may forget what you say, but they will never forget how you made them feel."
RE: Get data in a child parent relationship
CODE --> sql
Imagine such a simple stuff I had to take you all through. And again like I said,
I eventually got this :=
CODE --> sql