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 is pl sql used?
What are the indexing methods?
Is nosql faster than sql?
What is vector point function?
What is dbo in sql?
what is auto increment? : Sql dba
What is the purpose of using pl/sql?
How to read/write files from pl/sql?
How many functions are there in sql?
Can we create table inside stored procedure?
What are the steps for performance tuning.
How to raise user-defined exception with custom sqlerrm ?
Does inner join remove duplicates?
Describe different types of general function used in sql?
what is a database transaction? : Sql dba