i have a table emp and columns ename,empno,mgr_id,i need ename,manager name as result i.e employee respective manager.. example
empno ename mgr_id
1 john 3
2 paul 3
3 smith 1
4 kevin 1
5 stewart 2
result has to look like this
ename manager
john smith
paul smith
smith john
kevin john
stewart paul
can u plz help me out in this.....
Answer Posted / monika
select empno,ename
from emp
start with mgr_id is null
connect by prior empno=mgr_id;
Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
Does truncate release storage space?
what is union, minus and interact commands? : Sql dba
What is the difference between microsoft access and sql?
Explain correlated query work?
When is the explicit cursor used ?
how to use 'mysql' to run sql statements? : Sql dba
Can we update views in sql?
What programs use sql?
What is exception? What are the types of exceptions?
What are the different types of dbmss?
What do you mean by field in sql?
Write a sql query to find the names of employees that begin with ‘a’?
Is sqlite free?
What is the difference between union and union all command?
How do I restart sql?