SQL SERVER – The Self Join

A self-join is joining a table to itself. This is done by using table name aliases to give each instance of the table a separate name. Self Join is very useful when you want to compare values in a column to other values in the same column.

Self join and its example is very common question in the interview.

Let us take a look to example

01 Self Join

Self Join

02 Self Join

Self Join

03 Self Join

Self Join

04 Self Join

Self Join

3 comments