A self-join is a query in which a table is joined (compared) to
itself. So basically this join is
always performed on single table as opposed to other joins that need more than
one table. Self-joins are used to compare values in a column with other
values in the same column in
the same table.
To write the self join query we use a table twice in FROM clause and assign different alias to each instance of table because tables participating in self join have same name.
To write the self join query we use a table twice in FROM clause and assign different alias to each instance of table because tables participating in self join have same name.