Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
danielhai
Yak Posting Veteran
50 Posts |
Posted - 2002-07-30 : 14:32:26
|
Here we go with the multiple Hierarchies again. Based off the SQL Team article, what I'm wanting to achieve is the ability for an Employee to have multiple Bosses. For instance:tblEmployeeEmployeeID Name1001 Denis Eaton-Hogg 1002 Bobbi Flekman1003 Ian Faith1004 David St. Hubbins1005 Nigel Tufnel1006 Derek SmallstblEmployeeBossEmployeeID BossID1003 10011005 10011006 10011003 10021005 10021006 10021004 1003 I'm just very curious as to how to go about even thinking about how to query information like this ... ... any ideas? |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-07-30 : 15:01:24
|
| What specifically do you want to query for? Each person's boss? Each person's hierarchy?The problem here is that a person's boss can themselves have more than one boss, so there's no direct way to represent a specific lineage...and there can be more than one path to follow, and no way to enforce a specific path.You could potentially end up with a circular hierarchy too; a cyclic graph as Joe Celko discusses in SQL For Smarties.Can you describe further exactly what you want to do? And if you're actual tables different from the article or your example, PLEASE POST THE ACTUAL DDL and some sample data. |
 |
|
|
|
|
|