Created
April 16, 2019 14:32
-
-
Save ip75/2a65ce8c388d4180329f718ff9257140 to your computer and use it in GitHub Desktop.
get view of tree using select. oracle 11g
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------- HIERARCHYID => MERCID --------------------------- | |
select lpad(' ', 6 * level) || h.displayname as Tree, | |
hd.value mercid, | |
h.hierarchyid, | |
h.authid, | |
h.searchkey, | |
ad.dataid | |
from AUTHHIERARCHY h | |
left join hierarchydata hd | |
on hd.hierarchyid = h.hierarchyid | |
and hd.key = 'mercid' | |
left join authdata ad on ad.authid = h.authid | |
start with h.parentid = 0 | |
connect by prior h.hierarchyid = h.parentid | |
------------------------------------------------------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment