SQL Self Join is the kind of join in which a table is joined with itself means we are joining a table with that same table (which is also called Unary relationships), especially when the table has the FOREIGN KEY which references its PRIMARY KEY. If we want to join the table itself means that each row of the table is combined with itself and with every other row of the table.
The self join allows you to join the table to itself. It is useful for querying the hierarchical data or comparing rows within the same table. Till now, we have seen the Outer Join, Cross Join, Left Join, SQL Joins Overview and Inner Join in this blog.
#sql #sql self join #sql joins overview