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
Why is partition used in sql?
how do you login to mysql using unix shell? : Sql dba
What does seeding a database mean?
Can two tables have same primary key?
what is bdb (berkeleydb)? : Sql dba
Write an sql query to select all records from the table?
What is an inner join sql?
What is multiple partition?
What are the features of pl sql?
What are different types of statements supported by sql?
Which column of the user triggers data dictionary view displays the database event that will fire the trigger?
What does select top 1 do in sql?
What is sql procedures and functions?
How can you load multi line records? : aql loader
What is the purpose of the primary key?