Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT e.employee_id,
- e.first_name||' '|| e.last_name AS name,
- CONNECT_BY_ROOT e.manager_id managerID,
- CONNECT_BY_ROOT (e1.first_name||' '||e1.last_name) manager,
- LEVEL AS начальников,
- sys_connect_by_path(e1.first_name||' '||e1.last_name, ' / ') AS MANAGER_PATH
- FROM employees e
- join employees e1 ON e.manager_id=e1.employee_id
- CONNECT BY e.manager_id=PRIOR e.employee_id
- ORDER BY name, LEVEL DESC;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement