SELF JOIN in Teradata

Self join is a join where a table will be joined with itself.

SELECT a.column_name, b.column_name...
FROM table1 a, table1 b
WHERE a.common_filed = b.common_field;


Example: (employee)
employee_nameemployee_location
JoeNew York
SunilIndia
AlexRussia
AlbertCanada
JackNew York


SELECT e1.employee_name
FROM employee e1, employee e2
WHERE e1.employee_location = e2.employee_location
AND e2.employee_name='Joe';


Output:
employee_name
Joe
Jack