"rAinDeEr" <ta**********@gmail.com> wrote in message
news:11*********************@v46g2000cwv.googlegro ups.com...
Hi,
Need a query which satisfies the following condition ::
I have a table with fields
emp_no emp_name supervisor
111 harry 222
222 potter null
When I give an emp_no( For eg 111) the output should be
emp_name Supervisor
harry potter
When I give an emp_no( 222) the output should be
emp_name Supervisor
potter null
Thanks in advance
select
a.emp_name,
(select b.emp_name from emp_table b where a.supervisor = b.emp_no) as
supervisor
from emp_table a
where emp_no = 111