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 / sudhan
select e1.ename EmpName,e2.ename MgrName from emp e1,emp e2
where e1.mgr_id=e2.ename;
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Which column of the user triggers data dictionary view displays the database event that will fire the trigger?
what is the difference between delete and truncate commands? : Sql dba
What is parameter substitution in sql?
What is the difference between having and a where in sql?
Is sql open source?
what is table? : Sql dba
What is the difference between null value, zero, and blank space?
How do I find duplicates in a single column in sql?
what is an index? : Sql dba
What is the purpose of design view?
What is db journal file?
What is numeric function sql?
Is clustered index a primary key?
Can we update views in sql?
Can we create view in stored procedure?