All Subordinates of a Manager
Return the id and name of every direct and indirect report of employee 2, ordered by id.
Table schema
Employees(id INT PRIMARY KEY, name VARCHAR(50), manager_id INT NULL)Sample data
id | name | manager_id
1 | CEO | NULL
2 | VP1 | 1
3 | VP2 | 1
4 | Mgr | 2
5 | Dev | 4
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.