Self-join

by gowtham 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;

Tagged in:

762
like
0
dislike
0
mail
flag

You must LOGIN to add comments