How to use self join in sql server and what's it's important. Anonymous User183216-May-2013 Hi All!How to use self join in sql server and what's it's important.Please give any example.Thanks in advance! mssql servermssql server Updated on 16-May-2013
AVADHESH PATEL
16-May-2013Self Join
Self join correlates rows of a table with the other rows of the same table. It is used when a table has to be joined to itself to produce results.
Example
First you have to create a table EmpTable and enter the details like this:
EmpIDEmpNameEmpMgrID
1Smith2
2Sai3
3Suresh1
4Bill2
5Steve4
Output