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
Can we insert in view in sql?
Is sql a microsoft product?
What do we need to check in database testing?
What is user defined functions?
What are the different tcl commands in sql?
What are the advantages of indexing?
What is set transaction?
How do you run a query?
What is function and procedure in pl sql?
what is acid property in database? : Sql dba
what are the differences between char and nchar? : Sql dba
Are left and right joins the same?
what is the difference between clustered and non clustered index in sql? : Sql dba
What is embedded sql what are its advantages?
Can we use view in stored procedure?