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 |
btechrames
Starting Member
3 Posts |
Posted - 2014-06-08 : 10:53:33
|
hi friends,I need to write a sql that generate the hierarchy in an organization.Below an exampleemplid empname supervisor_id superv_name1 subu null null2 vid 1 sub3 ram 4 satis4 satis 2 vidi need an output to this query as below and also one important the supervisor ie supervisor_id and name is null is the top level,every employee also has to report to him and also to his all above supervisors.whoever joinng new to org the hierachy should be follwedempid empname supervisor_id superv_name3 ram 4 satis4 satis 2 vid2 vid 1 subu4 satis 1 subu3 ram 1 subu3 ram 2 vid5 kumar 1 subu5 kumar 4 satis5 kumar 2 vid1 subu null nullThanks n advance... |
|
bitsmed
Aged Yak Warrior
545 Posts |
Posted - 2014-06-08 : 15:23:36
|
Duplicate of [url]http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=194593[/url] |
|
|
|
|
|