Home » SQL & PL/SQL » SQL & PL/SQL » Employee Supervisor problem
Employee Supervisor problem [message #209109] Wed, 13 December 2006 06:25 Go to next message
raghuraja_r
Messages: 22
Registered: February 2005
Location: chennai
Junior Member

Hi,

I have a table that contains child_id, parent_id, ...
one child have one parent
one parent can have many child
a child will be a parent of another child.

I need a SQL that selects the child, its child,... so on

parent_id willbe the input.

Please help me in acheiving this result.
Thanks in advance.
Re: Employee Supervisor problem [message #209114 is a reply to message #209109] Wed, 13 December 2006 06:35 Go to previous messageGo to next message
Cthulhu
Messages: 381
Registered: September 2006
Location: UK
Senior Member
Look in the manual at connect by...prior.
Re: Employee Supervisor problem [message #272935 is a reply to message #209109] Mon, 08 October 2007 04:42 Go to previous messageGo to next message
nirmalkl_007
Messages: 4
Registered: January 2006
Location: Chennai
Junior Member

Hello Raghu

Use connect_BY_LEVEL and SYS_ON_CONNECT to get the desired result.

Cheers
Nirmal Kumar. N
Re: Employee Supervisor problem [message #272937 is a reply to message #209109] Mon, 08 October 2007 04:48 Go to previous messageGo to next message
Michel Cadot
Messages: 64140
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Have a look at the topic "Converting SQL from MSSQL to ORACLE"

Regards
Michel
Re: Employee Supervisor problem [message #272964 is a reply to message #272935] Mon, 08 October 2007 06:43 Go to previous messageGo to next message
pablolee
Messages: 2835
Registered: May 2007
Location: Scotland
Senior Member
I would imagine, that after nearly a year, the OP has probably found a solution to his problem / homework
Re: Employee Supervisor problem [message #272966 is a reply to message #272964] Mon, 08 October 2007 07:05 Go to previous messageGo to next message
Michel Cadot
Messages: 64140
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Laughing I didn't see the topic date.

Regards
Michel
Re: Employee Supervisor problem [message #272968 is a reply to message #272966] Mon, 08 October 2007 07:11 Go to previous message
pablolee
Messages: 2835
Registered: May 2007
Location: Scotland
Senior Member
Laughing I've done that a couple of time too
Previous Topic: ora_sql_txt function errors
Next Topic: how to use ORDER BY clause in VARCHAR2 datatype column?
Goto Forum:
  


Current Time: Fri Dec 09 05:51:52 CST 2016

Total time taken to generate the page: 0.05373 seconds