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 / john bershan
self join will accomplish this task.try below query
select a.ename,b.ename as manager from emp a,emp b
where a.empno = b.mgrid;
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
how to increment dates by 1 in mysql? : Sql dba
What is the sql case statement?
What are the parameter modes supported by pl/sql?
is mysql query is case sensitive? : Sql dba
What is sql performance tuning?
What is right join in sql?
What is sql character function?
Is sql similar to python?
Why procedure is used in sql?
What are sql constraints?
What is sql exception?
What is sqlca in db2?
What does inner join mean?
What is autocommit sql?
explain the options of myisamchk to improve the performance of a table. : Sql dba