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
Write a sql query to convert all character to uppercase after hypen.
What is the difference between left join and right join?
What are the advantages of sql? Explain
Does user triggers have entry for trigger with compilation errors?
how many triggers are allowed in mysql table? : Sql dba
what is the functionality of the function htmlentities? : Sql dba
Is null operator in sql?
How can I get the number of records affected by a stored procedure?
Is sql a oracle?
What is the benefit of foreign key?
who introduced sql?
What is a recursive join sql?
what is a stored procedure? : Sql dba
What is the mutating table and constraining table?
Enlist the characteristics of pl/sql?