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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL View

Author  Topic 

Dilip
Starting Member

1 Post

Posted - 2001-01-31 : 17:02:59
Hi,

I have a table with following columns and rows :

EMP_ID DESIGNATION SUPERVISOR_ID
1 Programmer(East) 7
3 Programmer(West) 11
4 Global Manager(East) 4
6 Sr. Proj Manager(East) 4
7 Project Manager(East) 6
10 Global Manager(West) 10
11 Project Manager(West) 12
12 Sr. Proj Manager(West) 10

I need to create a view based on above table. It should display

EMP_ID IMMEDIATE_SUPERVISOR TOP_SUPERVISOR
1 7 4
3 11 10
4 4 4
6 4 4
7 6 4
10 10 10
11 12 10
12 10 10

I really appreciate your suggestions/logic.

Thanks
   

- Advertisement -