Solved

ISLEAF explanation

Posted on 2013-06-07
2
509 Views
Last Modified: 2013-06-07
Experts,

I am a beginner with these functions and I'm hoping someone can explain the ISLEAF results in this query. The results are producing the correct hierarchy.

SELECT ETC_ID,    SYS_CONNECT_BY_PATH(etc_id, '$') ids,
                   SYS_CONNECT_BY_PATH(etc_name, '$') names,
                   CONNECT_BY_ISLEAF isleaf
              FROM ETC_TBL
              WHERE ETC_RETIRED_IND = 0
        CONNECT BY ETC_PARENT_ETC_ID = PRIOR etc_id
        START WITH ETC_PARENT_ETC_ID = 0

I attached a sample Excel output of a few records.
I am wondering why the first 2 records have ISLEAF = 0 (High level explanation of why I should expect that result)
isleaf-example.xlsx
0
Comment
Question by:jvoconnell
2 Comments
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 250 total points
ID: 39230744
I assume you have been to the docs for this?

http://docs.oracle.com/cd/E11882_01/server.112/e26088/pseudocolumns001.htm#SQLRF50940

CONNECT_BY_ISLEAF Pseudocolumn

The CONNECT_BY_ISLEAF pseudocolumn returns 1 if the current row is a leaf of the tree defined by the CONNECT BY condition. Otherwise it returns 0. This information indicates whether a given row can be further expanded to show more of the hierarchy.
0
 
LVL 1

Author Closing Comment

by:jvoconnell
ID: 39230852
Thank you. I did check online before posting but was strictly limiting myself (out of frustration) to "isleaf".  On the specific link you posted, the "LEVEL" psuedocolumn helped clarify things. I appreciate your time, you helped me out once again.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Query Records that don't match 8 42
SQL Query 34 99
Oracle sql query 7 61
dbms_crypto.decrypt   errors out 6 31
Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Via a live example, show how to take different types of Oracle backups using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question