Hi all,
i have a table as follows
empid empname mgrid deptid
1 a 3 4
2 b 1 5
3 c 2 3
4 d 3 6
5 e 4 7
i want the output as
empname mgrname
a c
b a
c b
d c
e d
Answer Posted / alok narayan
1.
select empname,(select empname from e1 b
where b.empid =a.mgrid) from e1 a;
2.
select a.empname empname,b.empname mgrname from e1 a,e1 b
where a.mgrid=b.empid order by a.empname ;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How can you load microsoft excel data into oracle? : aql loader
What is a composite primary key?
what is a view? : Sql dba
What is rownum in sql?
What is a join query?
what is the difference between nested subquery and correlated subquery?
what are enums used for in mysql? : Sql dba
What is sql procedures and functions?
What is a data manipulation language?
Can sql developer connect to db2?
Are stored procedures faster than dynamic sql?
What are different types of indexes?
what is a tablespace? : Sql dba
can sql servers linked to other servers like oracle? : Sql dba
what does it mean to have quoted_identifier on? : Sql dba