Recursive Hierarchy Help [message #637702] |
Thu, 21 May 2015 18:55 |
|
kiekar
Messages: 1 Registered: May 2015
|
Junior Member |
|
|
Hello,
First I would like to say that I only have basic SQL skills. I have one table PN_NEXT_LOWER_ASSEMBLY with two fields NHA_PN and NLA_PN that I need to work with that holds hierarchy data. The DB is Oracle but I'm not sure what version. I know from using visual representation that the most upper hierarchy PN is '49-20005-1' and that there is 4 levels down from there
I ran this query but I am not getting the results I need. As you will see level 2 is outputting
the same NLA_PN but should be outputting the P/Ns displayed in the next image.
I have copy of the output below and the actual hierarchy tree.
Any suggestions why I'm not getting the proper results would be much appreciated.
Thanks.
SELECT NHA_PN, NLA_PN, LEVEL
FROM PN_NEXT_LOWER_ASSEMBLY
WHERE NHA_PN = '49-20005-1'
CONNECT BY PRIOR NHA_PN = NLA_PN
ORDER BY LEVEL ASC
[EDITED by LF: fixed invalid image tag]
[Updated on: Fri, 22 May 2015 00:52] by Moderator Report message to a moderator
|
|
|
|
|
|