SELECT FOLD1.CF_ITEM_NAME AS Folder_Name, FOLD1.CF_ITEM_ID AS Folder_ID,
FOLD10.CF_ITEM_NAME||'\'||FOLD9.CF_ITEM_NAME||'\'||FOLD8.CF_ITEM_NAME||'\'||FOLD7.CF_ITEM_NAME||'\'||FOLD6.CF_ITEM_NAME||'\'||FOLD5.CF_ITEM_NAME ||'\'||FOLD4.CF_ITEM_NAME ||'\'||FOLD3.CF_ITEM_NAME||'\'||FOLD2.CF_ITEM_NAME AS Path
FROM CYCL_FOLD FOLD1, CYCL_FOLD FOLD2, CYCL_FOLD FOLD3, CYCL_FOLD FOLD4, CYCL_FOLD FOLD5, CYCL_FOLD FOLD6, CYCL_FOLD FOLD7, CYCL_FOLD FOLD8, CYCL_FOLD FOLD9, CYCL_FOLD FOLD10
WHERE FOLD2.CF_ITEM_ID = FOLD1.CF_FATHER_ID
AND FOLD3.CF_ITEM_ID (+) = FOLD2.CF_FATHER_ID
AND FOLD4.CF_ITEM_ID (+) = FOLD3.CF_FATHER_ID
AND FOLD5.CF_ITEM_ID (+) = FOLD4.CF_FATHER_ID
AND FOLD6.CF_ITEM_ID (+) = FOLD5.CF_FATHER_ID
AND FOLD7.CF_ITEM_ID (+) = FOLD6.CF_FATHER_ID
AND FOLD8.CF_ITEM_ID (+) = FOLD7.CF_FATHER_ID
AND FOLD9.CF_ITEM_ID (+) = FOLD8.CF_FATHER_ID
AND FOLD10.CF_ITEM_ID (+) = FOLD9.CF_FATHER_ID
and (FOLD1.CF_ITEM_NAME LIKE 'folder name')
FOLD10.CF_ITEM_NAME||'\'||FOLD9.CF_ITEM_NAME||'\'||FOLD8.CF_ITEM_NAME||'\'||FOLD7.CF_ITEM_NAME||'\'||FOLD6.CF_ITEM_NAME||'\'||FOLD5.CF_ITEM_NAME ||'\'||FOLD4.CF_ITEM_NAME ||'\'||FOLD3.CF_ITEM_NAME||'\'||FOLD2.CF_ITEM_NAME AS Path
FROM CYCL_FOLD FOLD1, CYCL_FOLD FOLD2, CYCL_FOLD FOLD3, CYCL_FOLD FOLD4, CYCL_FOLD FOLD5, CYCL_FOLD FOLD6, CYCL_FOLD FOLD7, CYCL_FOLD FOLD8, CYCL_FOLD FOLD9, CYCL_FOLD FOLD10
WHERE FOLD2.CF_ITEM_ID = FOLD1.CF_FATHER_ID
AND FOLD3.CF_ITEM_ID (+) = FOLD2.CF_FATHER_ID
AND FOLD4.CF_ITEM_ID (+) = FOLD3.CF_FATHER_ID
AND FOLD5.CF_ITEM_ID (+) = FOLD4.CF_FATHER_ID
AND FOLD6.CF_ITEM_ID (+) = FOLD5.CF_FATHER_ID
AND FOLD7.CF_ITEM_ID (+) = FOLD6.CF_FATHER_ID
AND FOLD8.CF_ITEM_ID (+) = FOLD7.CF_FATHER_ID
AND FOLD9.CF_ITEM_ID (+) = FOLD8.CF_FATHER_ID
AND FOLD10.CF_ITEM_ID (+) = FOLD9.CF_FATHER_ID
and (FOLD1.CF_ITEM_NAME LIKE 'folder name')
No comments:
Post a Comment