Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: Recursive Query

Re: Recursive Query

From: Lennart Jonsson <lelle2_at_bonetmail.com>
Date: Tue, 18 Mar 2003 23:35:44 +0100
Message-ID: <b58709$24etb5$1@ID-167942.news.dfncis.de>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US