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 / rajesh venati
select e.ename as employee_name,m.ename as manager_name from
emp e, emp m where e.mgr_id=m.empno;
| Is This Answer Correct ? | 8 Yes | 2 No |
Post New Answer View All Answers
how to see the create table statement of an existing table? : Sql dba
What is parallel hint?
Does oracle use sql?
What is column?
What is the difference between left join and right join?
what are the other commands to know the structure of table using mysql commands except explain command? : Sql dba
Differentiate pl/sql and sql?
table structure: ---------------- col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10 01-mar-2012 11:12:46 01-mar-2012 11:11:23 Write a query to display the result as shown below: col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10
how many tables will create when we create table, what are they? : Sql dba
What is clause?
Can %notfound return null after a fetch?
How many clustered indexes can be created on a table?
What is the use of index in sql?
How do you explain an index number?
What is informix sql?