Stats

Contributors: 1 Saturday, April 1, 2017
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial: riptutorial@gmail.com
Roadmap: roadmap

Get the Employees Managed by a Single Manager

Download mysql eBook

Example

SELECT e.emp_id , e.first_name , e.last_name FROM employees e INNER JOIN managers m ON m.mgr_id = e.mgr_id WHERE m.mgr_id = 'M01' ;

Results in:

EMP_IDFIRST_NAMELAST_NAME
E02ErinMacklemore
E04RonSonswan

Ultimately, for every manager we query for, we will see 1 or more employees returned.