MySQL Self Join | Beginner Tutorial with examples

preview_player
Показать описание
This video will discuss mysql self join with examples. Different type of joins is there : self join, inner join, left join, right join, full join and cross join.

A self join is a regular join, but the table is joined with itself.
I am using phpmyadmin for executing queries

A SELF JOIN is a join that is used to join a table with itself. In the previous sections, we have learned about the joining of the table with the other tables using different JOINS, such as INNER, LEFT, RIGHT, and CROSS JOIN. However, there is a need to combine data with other data in the same table itself. In that case, we use Self Join.

Self Join Syntax
SELECT column_name(s)
FROM table1 T1, table1 T2
WHERE condition;
T1 and T2 are different table aliases for the same table.

In video, example of employee with its address is shown

#knowledgethrusters #mysql #joins
Рекомендации по теме