Self Join
Self Join this is a regular join, Self Join is used to join a table to itself. There is no keyword for this join.
Syntax :
SELECT a.column_name b.column_name
FROM table1a, table1b
WHERE a.common_field = b.common_field;
Example : Figure in below we have customers table. Lets see how to work self Join in database.
Now, let see join this table using SELF JOIN as follows
Query :
SELECT a.Id b.Name, a.AddressOutput :
FROM customers a, customers b
WHERE a.Address = b.Address;
0 Comments