| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Recursive Query
On Tue, 18 Mar 2003 12:16:27 +0000, Ray wrote:
> Hi,
>
> I have a table with an Id that references itself recursively and need
> help building the query.
>
> Here's the table structure:
> employee_id PRIMARY_KEY
> employee_name
> supervisor_id
>
> The supervisor_id refers to the employee_id depending on who is the
> employee
> supervisor.
>
> My resultset should look like:
> employee_id - employee_name - SUPERVISOR_NAME (instead of Id)
>
> Thanks,
>
> -Ray
select
e1.employee_id, e1.employee_name, e2.employee_name from
employee e1, employee e2
where
e1.employee_id = ? and e1.supervisor_id = e2.employee_id
/Lennart Received on Tue Mar 18 2003 - 16:35:44 CST
![]() |
![]() |