A table was given with 3 columns like Manager id,Manager
Name and Employee name.
Question was to create hierarchy.

Answer Posted / sharad kumar

select manager name,employee name,level
from table_name
start with manager name is null /* optional*/
connect by prior nocycle employee name = manager name
/*Child = Parent */

Is This Answer Correct ?    20 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sql dialect?

537


What are hotfixes and patches?

541


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

1116


How do you update a sql procedure?

533


What is a design view?

533






how to rename an existing table in mysql? : Sql dba

584


explain the difference between bool, tinyint and bit. : Sql dba

538


What is offset in sql query?

604


Why are aggregate functions called so?

526


Explain the difference between sql and mysql.

575


Is nosql faster than sql?

552


What are the indexing methods?

591


Why do we use sql constraints? Which constraints we can use while creating database in sql?

555


What are string functions in sql?

688


How do you drop a trigger?

558