title: Count all subordinates who directly or indirectly reports to managers
body: <p>I got a problem with one task.</p>
  
  <p>I need to count all subordinates (distinct) who directly or indirectly reports to a specific manager</p>
  
  <p>I have an <code>Employee</code> table like this:</p>
  
  <pre><code>EMPLOYEE_ID Int,
  MANAGER_ID Int,
  EMPLOYEE_NAME varchar(200)
  </code></pre>
  
  <p>Example:</p>
  
  <pre><code>            Alex(1)
      --------------------
      Jhon(2)          Kevin(3)
  ------------------------------
  Mike(4) Amanda(5)  Tom(6) Jery(7)
  </code></pre>
  
  <p>I can count only employee who directly reports to a manager:</p>
  
  <pre><code>SELECT 
      MANAGER_ID
     ,COUNT(MANAGER_ID) as SubCount
  FROM [dbo].[EMPLOYEE]
  GROUP BY MANAGER_ID
  </code></pre>
  
  <p>But in result I have something like this:</p>
  
  <pre><code>Manager_ID | SubCount
  ----------------------
  1          | 2
  2          | 2
  3          | 2
  ----------------------
  </code></pre>
  
  <p>Instead:</p>
  
  <pre><code>Manager_ID | SubCount
  ----------------------
  1          | 6
  2          | 2
  3          | 2
  ----------------------
  </code></pre>
  
  <p>I will be happy for any suggestions or idea how to do this.</p>