Reputation: 1929
I have an Employees table. I am using Oracle database.
Employees Table
- Employee_id
- first_name
- last_name
- manager_id
- email_id
How can I query all the employees under another employee ?
Thanks.
Upvotes: 1
Views: 145
Reputation: 86798
Oracle has a CONNECT BY
syntax...
SELECT *
FROM employees
START WITH employee_id = 123
CONNECT BY PRIOR employee_id = manager_id
Upvotes: 2