SQLIntermediate#joins

What is a SELF JOIN?

Joining a table to itself using two aliases, typically to walk a hierarchy stored in the same table.

Example
SELECT e.name AS employee, m.name AS manager
FROM employees e
JOIN employees m ON e.manager_id = m.id;

Related Questions

1
SQLIntermediate#aggregates

Difference between WHERE and HAVING?

Open
2
SQLIntermediate#queries

What is the logical order of execution of a SELECT query?

Open
3
SQLBeginner#keys

Primary key vs unique key vs foreign key?

Open