What is Self Join in SQL ?
In the previous section, we have discussed what is joining and its types , in this section we will discuss the rest of the types. Self-join in SQL: Sometime we need to retrieve rows of the same table by applying some constraints to its fields. In these types of cases, self-join is the best option. It is the type of join in which one table is joined with itself depending on some condition that is specified in WHERE CLAUSE, means that the rows of the same table are compared for generating results. So self-join is used to merge the rows of the same table by matching them. There might be an error while writing the Query of self-join if the user will use the same table name twice after FROM keyword, so for resolving that problem we can use the different Alias of the same table. Syntax of Self Join: SELECT column_name(N) FROM table1 T 1 , table1 T 2 WHERE condition ; Here T1 and T2 are the aliases of table1. So suppose we have Students tabl...