![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I don't know how to begin on a query (SELECT statement) to find all the tasks assigned to an arbitrary manager (say, staffID='JSmith') and her organization, that is, assigned to all her underlings, and their underlings, and .... For that matter, I don't even know how to find everyone in her organization (at all levels). - All individuals have only one manager - Tasks are assigned to individuals - A manager at any level may have direct reports and sub-managers The table structure: tblStaff ------------- staffID reportsToID (staffID of direct manager) tblTasks -------------- taskID assignedToID (staffID of individual responsible for task) Any help would be greatly appreciated. Bruce |
#3
| |||
| |||
|
|
Bruce Hensley wrote: I don't know how to begin on a query (SELECT statement) to find all the tasks assigned to an arbitrary manager (say, staffID='JSmith') and her organization, that is, assigned to all her underlings, and their underlings, and .... For that matter, I don't even know how to find everyone in her organization (at all levels). - All individuals have only one manager - Tasks are assigned to individuals - A manager at any level may have direct reports and sub-managers The table structure: tblStaff ------------- staffID reportsToID (staffID of direct manager) tblTasks -------------- taskID assignedToID (staffID of individual responsible for task) Any help would be greatly appreciated. Bruce I haven't used them yet but you may find the Shaped Query for ADO |
#4
| |||
| |||
|
|
Bruce Hensley wrote: I don't know how to begin on a query (SELECT statement) to find all the tasks assigned to an arbitrary manager (say, staffID='JSmith') and her organization, that is, assigned to all her underlings, and their underlings, and .... For that matter, I don't even know how to find everyone in her organization (at all levels). - All individuals have only one manager - Tasks are assigned to individuals - A manager at any level may have direct reports and sub-managers The table structure: tblStaff ------------- staffID reportsToID (staffID of direct manager) tblTasks -------------- taskID assignedToID (staffID of individual responsible for task) Any help would be greatly appreciated. Bruce You can find information about hierarchical queries at http://download-west.oracle.com/docs...4a.htm#2053937 URL may wrap. Regards /Rauf |
#5
| |||
| |||
|
#6
| |||
| |||
|
#7
| |||
| |||
|
#8
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |