Explain Connect by Prior?

Answer Posted / abhijit

The start with .. connect by clause can be used to select
data that has a hierarchical relationship (usually some sort
of parent->child (boss->employee or thing->parts).


select a.*, level from emp a
start with mgr is null
connect by mgr = prior empno;

The start with .. connect by clause can be used to select
data that has a hierarchical relationship (usually some sort
of parent->child (boss->employee or thing->parts).

Is This Answer Correct ?    19 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the most common sql injection tool?

532


what tools available for managing mysql server? : Sql dba

513


Explain the working of primary key?

593


Explain the types of joins in sql?

558


what is the difference between join and union? : Sql dba

535






What are sql constraints?

550


What is cte sql?

507


explain primary keys and auto increment fields in mysql : sql dba

510


How to use distinct and count in sql query? Explain

597


How to start the command-line sql*plus?

551


What is sql exception?

507


How do you update a table in sql?

510


What is function and procedure?

554


What is rank function in sql?

520


What are all the common sql functions?

550