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 / alok narayan
1.
select empname,(select empname from e1 b
where b.empid =a.mgrid) from e1 a;
2.
select a.empname empname,b.empname mgrname from e1 a,e1 b
where a.mgrid=b.empid order by a.empname ;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
what is schema? : Sql dba
What is Difference Between Unique and Primary Key Constraints?
What are inner outer left and right joins in sql?
What is date functions?
How delete all data from all tables in sql?
What is query syntax?
What is the difference between sql, mysql and sql server?
How can you know that statistics should be updated?
What are the types of records?
What are the different parts of a package?
What are sql queries used for?
What is sql stand for?
Write the order of precedence for validation of a column in a table? I. Done using database triggers. Ii. Done using integarity constraints
Is it possible to read/write files to-and-from PL/SQL?
Can a table contain multiple foreign key’s?