Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Up Tables & Relationship

Status
Not open for further replies.

Jusfire

Programmer
Jan 18, 2002
31
0
0
US
Hey all been awhile since I've been here so here goes...

I would like to set up data so it'll end up like this


101
102
103
104
105------109
106 111
107 114------115
108 116 117
110
112------118------120
113 119

Basically, it's the old boss employee thing -- where a one person works for another who works for another etc.

Utimately I'd love to incorporate a treeview that would show this information. Obviously the numbers would be something like 'LastName, FirstName'.

Any help would be much appreciated.

Justin
 
Basically you have

People:
Employee Number.....Name
==========.....========
001 Joe Doe
123 Jenny Smit
379 Heinrich Glott

Organisation:
Boss__________......Subordinate
=========......=============
379 123
379 001

That bit is a doddle. However displaying it is more tricky as SQL does not have an iteration concept. What you probably have to do is left join Organisation to itself N times where N is the maximum depth of the organisational chart.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top