self join in sql server
/* SELF JOIN - Joining a table with itself is called as self join.
It is classified under any type of join.
INNER JOIN
OUTER JOIN
CROSS JOIN. */
SELECT Column_List
FROM Left_Table_Name AS Alias_Name
JOIN_TYPE Right_Table_Name AS Alias_Name
ON Alias_Name.Column_List [Operator] Alias_Name.Column_List
/* Example*/
SELECT E.Name AS Employee, M.Name AS Manager
FROM tblEmployee E
LEFT JOIN tblEmployee M
ON E.ManagerID = M.EmployeeID