Self-join
by gowtham[ Edit ] 2010-02-11 16:20:22
A self-join is joining a table to itself.[2] This is best illustrated by the following example.
An example solution query could be as follows:
SELECT F.EmployeeID, F.LastName, S.EmployeeID, S.LastName, F.Country
FROM Employee F, Employee S
WHERE F.Country = S.Country
AND F.EmployeeID < S.EmployeeID
ORDER BY F.EmployeeID, S.EmployeeID;