A SELF JOIN is not a separate SQL keyword but a technique that uses any standard JOIN (INNER, LEFT, etc.) to relate a table to itself. By assigning different aliases to the same table, you create two logical instances that the optimizer can treat as separate sources. This is useful when rows in a table reference other rows in the same table (such as parent-child hierarchies, predecessor-successor relationships, or time-based comparisons). A SELF JOIN behaves like the JOIN type you specify (INNER, LEFT, RIGHT) and inherits its performance characteristics, including the need for indexed join columns to avoid full table scans. Because the table is scanned twice, large tables can be expensive to self-join without proper indexing. SELF JOINs can be combined with aggregation, window functions, and subqueries. Most SQL dialects require aliases to distinguish the two table instances; failing to alias will raise an ambiguous-column error or reference-cycle warning.
JOIN, INNER JOIN, LEFT JOIN, RIGHT JOIN, CROSS JOIN, TABLE ALIASES, HIERARCHICAL QUERIES
SQL-92 (conceptual join technique)
A SELF JOIN is a pattern that can use INNER JOIN or any other join type. The term simply means the table appears on both sides of the JOIN.
Yes. Aliases are required so the database engine can distinguish between the two logical instances of the same table and resolve column names unambiguously.
Create indexes on the join columns, limit the rows scanned with WHERE clauses, and avoid selecting unneeded columns to reduce I/O.
Yes. You can join the same table multiple times with different aliases to traverse deeper hierarchical levels or compare several periods at once.