Skip to main content

Command Palette

Search for a command to run...

Self-Joins

When to Use

Published
1 min readView as Markdown
D

I ❤️ Oracle APEX

Self-joins are used to compare rows within the same table, often for hierarchical data.

Example: Find Employees and Their Managers

SELECT 
  e.employee_id, 
  e.name AS employee_name, 
  m.name AS manager_name 
FROM empLoyees e 
LEFT JOIN employees m ON e.manager_id = m.employee_id;