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 mdf ldf and ndf?

563


Does pdo prevent sql injection?

520


what is bcp? When is it used?

582


How do I start sql profiler?

559


what are string data types? : Sql dba

514






How do temporal tables work?

521


How do you update f as m and m as f from the below table testtable?

1084


What is difference between sql and excel?

515


What are the various restrictions imposed on view in terms of dml?

523


Does execute immediate commit?

700


What are sql data types?

548


what are all the common sql function? : Sql dba

586


What is scope and visibility in PL/SQL?

598


What is recursive join in sql?

550


How is a PL/SQL code compiled?

670