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 |
oitsubob
Yak Posting Veteran
70 Posts |
Posted - 2005-10-11 : 22:58:06
|
Hi All!I'm working on a hierarchy table using a SQL Tree based on a model described by Joe Celko.http://www.intelligententerprise.com/001020/celko.jhtml?_requestid=49180In his example #1), he shows a query to find the employee and all of his/her supervisors.What I need to do is convert that from:supervisor4 (VP)supervisor3 (General Manger)supervisor2 (District Manger)supervisor1 (First Level Manager)employeeTo:employee supervisor1 supervisor2 supervisor3 supervisor4Does anyone have any tips on how to go about doing something like that? Keep in mind, this isn't going to be done for one employee at a time, but for several thousand. Also, there might be times where the employee reports directly to the district manager rather than to a First Level Manager so I'd need for that column's value to be null while the others would be populated.Any help would be appreciated.Thanks,Bob |
|
spirit1
Cybernetic Yak Master
11752 Posts |
|
oitsubob
Yak Posting Veteran
70 Posts |
Posted - 2005-10-13 : 11:22:56
|
That worked incredibly well! Thanks for the tip :)Bob |
|
|
pvinesh
Starting Member
3 Posts |
Posted - 2008-03-14 : 06:30:22
|
I have a table with only one column asEmp_NameABCDEI want to display this data asEmp_NameA, B, C, D, EIs this possible? I am using SQL server 2005.Any help is appreciated.Regards,Vinesh |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
Xerxes
Aged Yak Warrior
666 Posts |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-03-25 : 11:43:35
|
amazing... you're still alive??_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
|
|
|
|
|
|
|