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
How do you use join?
What is difference between sql and oracle?
what are the differences between char and varchar? : Sql dba
What is minus?
What are primary key and foreign key and how they work?
What is 19 null in sql?
How do you sort in sql?
What is difference between sql and excel?
what is a trigger in mysql? Define different types of trigger. : Sql dba
Mention what does plvtab enables you to do when you showthe contents of pl/sql tables?
What are sql data types?
How does pl sql work?
Is microsoft sql free?
what is the syntax for using sql_variant_property? : Transact sql
How many databases can sql express handle?