Syntax of SELF JOIN in SQL-
SELECT <column_name(s)>
FROM <table1> t1, <table1>t2
WHERE<condition>;
Example of SELF JOIN in SQL-
SELECT A.CustomerName AS Customer1, B.CustomerName AS Customer2, A.City
FROM Customers A, Customers B
WHERE A.CustomerID <> B.CustomerID
AND A.City = B. City;
— SELF JOIN query customers that are from the same city.