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
Why use truncate instead of delete?
Define concurrency control. : Transact sql
Which tcp/ip port does sql server run on? How can it be changed? : Sql dba
What is difference between left and right outer join?
I need a function for a train ticket reservation please answer it thanks in advance
How many types of relationship are there?
Is trigger a stored procedure?
how to convert character strings to numeric values? : Sql dba
What is nosql example?
Explain how can you save or place your msg in a table?
What is clause?
What are the types of variable use in pl sql?
How do I view tables in sql developer?
What is a delimiter in sas?
What is sql entity?