Guest User

Untitled

a guest
Nov 22nd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. Person_ID | Location | Role
  2. ----------------------------
  3. 101 Delhi Manager
  4. 102 Mumbai Employee
  5. 103 Noida Manager
  6. 104 Mumbai Employee
  7. 105 Noida Employee
  8. 106 Delhi Manager
  9. 107 Mumbai Manager
  10. 108 Delhi Employee
  11. 109 Mumbai Employee
  12.  
  13. Person_ID | Status
  14. -------------------
  15. 101 Active
  16. 102 Active
  17. 103 Inactive
  18. 104 Active
  19. 105 Active
  20. 106 Inactive
  21. 107 Active
  22. 108 Active
  23. 109 Inactive
  24.  
  25. Location | MANAGER COUNT | EMPLOYEE COUNT
  26. Delhi 1 1
  27. Mumbai 1 1
  28. Noida 0 1
  29.  
  30. 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')... and I get lost here
Add Comment
Please, Sign In to add comment