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 / gunturajesh
select a.empname empname,b.empname mgrname from emp a,emp b
where a.mgrid=b.empid
| Is This Answer Correct ? | 20 Yes | 2 No |
Post New Answer View All Answers
Explain mutating table error.
how to select first 5 records from a table? : Sql dba
What are functions in sql?
What is delimiter in pl sql?
Which are the different character-manipulation functions in sql?
what are properties of a transaction? : Sql dba
Which column in the user.triggers data dictionary view shows that the trigger is a pl/sql trigger?
How is data stored in sql?
What is the difference between union and union all command?
What is procedure and function?
How is sql used in oracle?
What is the difference between view and stored procedure?
Can we use insert statement in function?
Why do we need sharding?
how to delete duplicate rows from a join tables(I have three tables on that join) how do you know which join is need to be used? The select statement I have is: SELECT gc_skill_type.skill_type, gc_area_tec.area, gc_technology.technology, gc_technology.id_technology, gc_area_tec.id_area_tec FROM gc_skill_type, gc_area_tec, gc_technology WHERE gc_area_tec.id_skill_type (+) = gc_skill_type.id_skill_type AND gc_technology.id_area_tec (+) = gc_area_tec.id_area_tec order by gc_skill_type.skill_type asc, gc_area_tec.area asc, gc_technology.technology asc