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 / suresh babu
select t1.empname,t2.empname from emp t1,emp t2 where
t1.mgrid = t2.empid;
This query is self join,Which is display your requirement.
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What is bind variable in pl sql?
What is parameter substitution in sql?
How to connect a sql*plus session to an oracle server?
How insert into statements in sql?
Explain select statements in sql?
What is materialized view. What are different methods of refresh?
When do we use triggers?
What is a string data type in sql?
what is the difference between a web-garden and a web-farm? : Sql dba
Where can I learn sql for free?
What is indexes?
Enlist the advantages of sql.
How to fix oracle error ora-00942: table or view does not exist
how to add a new column to an existing table in mysql? : Sql dba
What is trigger with example?