SQL Self Join
What is a self join typically used for?
SELECT e1.name, e2.name as manager
FROM employees e1
JOIN employees e2 ON e1.manager_id = e2.id;
Sign in to answer questions and track your progress
Sign InWhat is a self join typically used for?
SELECT e1.name, e2.name as manager
FROM employees e1
JOIN employees e2 ON e1.manager_id = e2.id;
Sign in to answer questions and track your progress
Sign In