Self Joins and Table Aliases in MySQL

Published July 26, 2025 By Sai Sree Ram Gundepudi

Self Join Example

SELECT a.name AS emp1, b.name AS emp2 
FROM employees a, employees b 
WHERE a.manager_id = b.id;

Aliases (a, b) help refer to the same table twice.

Was this solution helpful?

Your feedback helps improve our technical knowledge repository.

Share this article