Main difference between Self Join and Equi Join is that, In Self Join we
join one table to itself rather than joining two tables. Both Self Join and
Equi Join are types of INNER Join in SQL but there is subtle difference between
two. Any INNER Join with equal as join predicate is known as Equi Join. SQL
Joins are fundamental concept of SQL similar to correlated
and noncorrelated subqueries or using group by clause and good
understanding of various types of SQL join is must for any programmer. By the
way If you have written INNER join using where clause than using comparison
operator as = will be known as equi join. Equi join or Self
join are not a formal join or part of syntax, instead they are just popular way
to refer certain join examples. One of the best example of Self Join, I have
seen in SQL Interview questions is "How do you find all Employees who are
Managers in Employee table", which is commonly asked along with another
popular question how
to find second highest salary of employee or questions related to join
three tables in one sql query. In this SQL tutorial we will learn self join
by example while solving this SQL query.