I have a hierarchy as follows
[tt]
|
_1__
| |_10__
| | |_11
| |
| |
| |_20
| |
| |_30__
| |_31
| |
| |_32
|
_2
|
.
.
.
[/tt]
This hierarchy is stored in a table with child/parent relationship...
TABLE: T_LINK
[tt]LINE# PARENT_LINE# LEVEL
1 - 1
10 1 2
11 10 3
20 1 2
30 1 2
31 30 3
32 30 3
2 - 1[/tt]
The LEVEL represents the "node count" from the top (LEVEL = 1 for LINE# = 1 b/c it is the top node).
I am having trouble denormalizing this information into a "flat" table with the following format (assuming a maximum of eight possible levels):
TABLE: T_LINK_DENORM
[tt]LEVEL1 LEVEL2 LEVEL3 LEVEL4 LEVEL5 LEVEL6 LEVEL7 LEVEL8
1 10 11
1 20
1 30 31
1 30 32
2[/tt]
Any help would be GREATLY appreciated.
[tt]
|
_1__
| |_10__
| | |_11
| |
| |
| |_20
| |
| |_30__
| |_31
| |
| |_32
|
_2
|
.
.
.
[/tt]
This hierarchy is stored in a table with child/parent relationship...
TABLE: T_LINK
[tt]LINE# PARENT_LINE# LEVEL
1 - 1
10 1 2
11 10 3
20 1 2
30 1 2
31 30 3
32 30 3
2 - 1[/tt]
The LEVEL represents the "node count" from the top (LEVEL = 1 for LINE# = 1 b/c it is the top node).
I am having trouble denormalizing this information into a "flat" table with the following format (assuming a maximum of eight possible levels):
TABLE: T_LINK_DENORM
[tt]LEVEL1 LEVEL2 LEVEL3 LEVEL4 LEVEL5 LEVEL6 LEVEL7 LEVEL8
1 10 11
1 20
1 30 31
1 30 32
2[/tt]
Any help would be GREATLY appreciated.