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 are set operators in sql? : Sql dba

726


What does where 1 1 mean in sql?

746


How do you modify a table in sql?

800


What is user defined functions?

746


explain advantages of myisam over innodb? : Sql dba

802






Is left join same as inner join?

723


Why do we create views in sql?

779


What are analytical functions in sql?

730


how to include numeric values in sql statements? : Sql dba

770


What is union and union all keyword in sql?

723


Does sap use sql?

717


How can we implement rollback or commit statement in a trigger?

787


What is sequence in sql?

720


Can we join same table in sql?

738


What are primary key and foreign key and how they work?

744