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
What are the two types of periodical indexes?
What is the use of %rowtype?
What is difference between mysql and postgresql?
Can we use distinct and group by together?
What is record data type?
How to run pl sql program in mysql?
How many types of tables are there?
What is the usage of the distinct keyword?
What are different types of functions in sql?
Is sql a scripting language?
Is primary key clustered index?
How do I remove all records from a table?
What are different types of triggers?
What are the packages in pl sql?
What are different types of tables in sql?