Created
June 13, 2015 04:34
-
-
Save coolicer/4051ef701a41edb4fb21 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
SELECT TWO.STFN_ID, | |
LISTAGG(TWO.PDOB_NAME, ',') WITHIN GROUP (ORDER BY TWO.PDOB_NAME) "PROC" | |
FROM | |
(SELECT ONE.STFN_ID, | |
ONE.STFN_PARENT, | |
ONE.STFN_NAME, | |
ONE.STFN_INFO, | |
PROC.PDOB_NAME, | |
PROC.PDOB_INFO | |
FROM | |
(SELECT SYS.*, | |
R.PDOB_ID | |
FROM T_SYSTEM_FUNC SYS | |
LEFT JOIN T_FUNC_PROCEDURE R | |
ON SYS.STFN_ID = R.STFN_ID | |
WHERE SYS.IS_USING = 1 | |
) ONE | |
LEFT JOIN T_PROCEDURE_OBJ PROC | |
ON ONE.PDOB_ID = PROC.PDOB_ID | |
WHERE PROC.IS_USING = 1 | |
) TWO GROUP BY TWO.STFN_ID; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment