title: Select different count from same table
body: <p>I have the table T_LOCATION_DATA on Oracle DB as follows:</p>
  
  <pre><code>Person_ID | Location | Role
  ----------------------------
  101         Delhi      Manager
  102         Mumbai     Employee
  103         Noida      Manager
  104         Mumbai     Employee
  105         Noida      Employee
  106         Delhi      Manager
  107         Mumbai     Manager
  108         Delhi      Employee
  109         Mumbai     Employee
  </code></pre>
  
  <p>Another table is T_STATUS with following data:</p>
  
  <pre><code>Person_ID | Status
  -------------------
  101         Active
  102         Active
  103         Inactive
  104         Active
  105         Active
  106         Inactive      
  107         Active     
  108         Active
  109         Inactive
  </code></pre>
  
  <p>I am trying to get the count of both Employee and Manager who are Active; group by location in a single query so that the result comes as follows:</p>
  
  <pre><code>Location  |   MANAGER COUNT |  EMPLOYEE COUNT
  Delhi         1                1
  Mumbai        1                1
  Noida         0                1
  </code></pre>
  
  <p>I am trying with following query but with no result:</p>
  
  <pre><code>select location, count (a.person_id) as MANAGER COUNT, 
                   count (b.person_id) as EMPLOYEE COUNT 
  from   T_LOCATION_DATA a,T_LOCATION_DATA b 
  where  a.person_id in (select person_id from t_status where status='Active')
  </code></pre>
  
  <p>... and I get lost here</p>
  
  <p>Can someone guide me on this please?</p>