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 the purpose of primary key?
what is uncommittable transactions? : Transact sql
What is sql trigger example?
How many sql are there?
What are the most important ddl statements in sql?
What is a composite primary key?
What is cursor and its types?
What does the base_object_type column shows in the user.triggers data dictionary view?
What are different types of sql commands?
What is clause?
What are the different schemas objects that can be created using pl/sql?
What is cte?
Where the sql database files are stored?
What is compute?
If the application is running very slow? At what points you need to go about the database in order to improve the performance?