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 Query

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-01-30 : 11:16:54
Dilipkumar writes "Hi,

I have 2 tables

Table1:
EMP_ID,	LEVEL
1, 100
2, 200

Table2:
LEVEL, LEVEL_NM, PARENT_LEVEL
100, Programmer, 200
200, State Manager, 300
300, Global Manager, 400
400, VP, 400


I need to write a query which returns full hierarchy for particular EMP_ID.

For EMP_ID=1 I should get results
1 VP/Global Manager/State Manager/Programmer

For EMP_ID=2 I should get results
2 VP/Global Manager/State Manager

I really appreciate your help.
SQL Server : 7.0

Thanks"
   

- Advertisement -