Self-Joins
Jump to navigation
Jump to search
Self Joins are used when a table must be joined to itself to retrieve the data you need. Table aliases are required in the FROM clause to perform self-join
SELECT r.firstname, r.lastname, r.referred, c.lastname "Referred" FROM customers c, customers r WHERE c.referred = r.customer#;