Pickup the latest copy of SQL for smarties, the examples in chapter 18,19,20 (I believe) are about recursion and the examples are positions within an org chart.  Or if your on SQL 2k you can read this article for another approach:
    Basically, most discussions on recursion center around org charts.  There are two major theories about how to do it best, one is recursion when you pull the data, the other is recursion when you update the tree.  Both methods are discussed and compared in the later chapters of SQL for smarties.
 
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Schreck, Tom
Sent: Wednesday, September 18, 2002 8:47 AM
To: [EMAIL PROTECTED]
Subject: SQL Question

I have a database of personnel which contains manager-employee relationship data.  The personnel record contains the id of that person’s manager (numManagerID).  numManagerID points to another record within the personnel table.  I need to have a recordset containing all personnel who’s in a manager’s organization, not just direct reports.  Has anyone done something similar to this?  I’m envisioning a lot of looping to build a recordset of all personnel within a given manager’s organization.  Any help/advice would be appreciated.

 

Thanks -

 

Tom Schreck

817-252-4900

[EMAIL PROTECTED]

 

I have not failed.  I've found 10,000 ways that won't work.

 

- Thomas Edison

 

Reply via email to