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 cursor and its type, what is ref cursor write a syntax to pass ref cursor into procedure out fucntion and call the procedure
Can one improve the performance of sql*loader? : aql loader
How do you respond to dementia behavior?
how to use regular expression in pattern match conditions? : Sql dba
What is the purpose of design view?
describe mysql connection using mysql binary. : Sql dba
How does stored procedure reduce network traffic?
what is 'mysqlimport'? : Sql dba
how to drop an existing table in mysql? : Sql dba
How to run sql*plus commands in sql developer?
explain what is mysql? : Sql dba
What is sql lookup?
What is error ora-12154: tns:could not resolve the connect identifier specified?
what are the different type of normalization? : Sql dba
Why sql query is slow?