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 |
|
basicconfiguration
Constraint Violating Yak Guru
358 Posts |
Posted - 2010-02-12 : 14:43:24
|
| Table1 has 3 col.empid, empname, manager1,'xxx', JOHN2,'fff', MICHAEL3,'uuu', SAMHow could I get direct and indirect empname that are under managerJOHN?results:xxx, JOHNfff, JOHNuuu, JOHN |
|
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2010-02-12 : 15:24:05
|
| Data doesn't show that...how do you say JOHN is the manager of fff and uuu...they have their own managers according to the sample data. |
 |
|
|
basicconfiguration
Constraint Violating Yak Guru
358 Posts |
Posted - 2010-02-12 : 18:53:09
|
| But i wanna get them all just like the result or I can't? |
 |
|
|
basicconfiguration
Constraint Violating Yak Guru
358 Posts |
Posted - 2010-02-13 : 04:03:32
|
| Never mind the question that I asked is wrong. The question it is to get the number of direct and indirect employees whom are under the managers. I was reading in BOL about common table expressions and I found the answer in one of the examples. |
 |
|
|
|
|
|