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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Query

Author  Topic 

Neena_2008
Starting Member

6 Posts

Posted - 2008-12-02 : 05:26:16
I hav a 2 table like this

-----Table 1 :--------

MangerID EmpID
15 18
15 10
18 60
18 3084
60 78
60 57

A manager can be a supervisor as well as employee at the same time.I want to create a hierarchy report with the top level manager at the top & subordinates at the bottom.
I want a result like this :

Supervisor Sub1 Sub2 Sub3
15 18 3084 null
15 18 60 78
15 18 60 57
15 10 null null

Can any1 help me with a query?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-12-02 : 05:33:51
Using which version of SQL Server?


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-12-02 : 05:55:11
Duplicate post
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=115500



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
   

- Advertisement -