SELF JOIN



SELF JOIN
A table join with itself.

SYNTAX
SELECT comma_separeted_column_names
FROM table1 alias1, table1 alias2
WHERE condition;


EXAMPLE
SELECT t1.username User1, t2.username User2
FROM users T1, users T2
WHERE t1.id <> t2.id 
AND t1.area = t2.area
ORDER BY t1.area

Note: This query will select the username which are belonging to same area