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
What are the sql commands?
Is the primary key an index?
Explain clause in sql?
what are the type of locks ? : Sql dba
What is the difference between an inner and outer join?
Define sql delete statement.
What is a natural join?
how can we submit a form without a submit button? : Sql dba
What is the use of index in hive?
How to find 3rd highest salary of an employee from the employee table in sql?
Do stored procedures prevent sql injection?
If i can use sys.check_constraints to display my constraints from my database using sql server 2005, how can i display then if i am using sql server 2000????
Can you rollback after commit?
Hi am new to PLSQL & facing problems in writing code like in SP, Functions, so any one having some SP coding with in depth explanation please share with me my Email ID suvarnaatsuvarna@rediffmail.com Or taking tanning on this please do contact me
What is oracle pl sql developer?