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 |
|
rajiv@software
Starting Member
3 Posts |
Posted - 2010-08-14 : 08:25:45
|
| I have table name employee with following fields -EmpID Name ManagerIDagainst each employee, manager id is avaiable and a manager is also an employee...i need a sql query which will provide the list of all direct report with their status, that whether the direct report is a manager or individual contributor.for example - if empid 1 is a manager and under 1 there are 5 direct reports, out of 5, 4 direct reports are manager but 1 is individual contributor...i need the result set like - for EmpID 1 - there direct reports details - EmpID - Name - Manager_Status2 B Y3 C N4 D Yhope, i am able to explain my requirement, please do revert if you need any further details. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-08-14 : 12:49:37
|
| how is relation maintained in table? I cant see how you can find out managers from given table------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
rajiv@software
Starting Member
3 Posts |
Posted - 2010-08-14 : 13:07:44
|
employee table contains the details of all the employee even for the managers also, there will be an entry in the table for the managers also like managers are also an employee.quote]Originally posted by visakh16 how is relation maintained in table? I cant see how you can find out managers from given table------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/[/quote] |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-08-14 : 13:16:40
|
| thats fine. but there should be field to indicate whose manager is whom. In your table, its not there------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|