Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- Person_ID | Status
- -------------------
- 101 Active
- 102 Active
- 103 Inactive
- 104 Active
- 105 Active
- 106 Inactive
- 107 Active
- 108 Active
- 109 Inactive
- Location | MANAGER COUNT | EMPLOYEE COUNT
- Delhi 1 1
- Mumbai 1 1
- Noida 0 1
- 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