Bhasker Das
What is a self join?
By Bhasker Das in SQL Server on Jul 13 2006
  • Santosh Kumar
    Jun, 2016 28

    Self join is join which is join against equality-LikeEmployee Id is the Id of Manager Select E.Name as E,M.Name as M from Emp Where E.id=M.idwhere

    • 0
  • nbp
    Aug, 2006 3

    Just in case, if they ask you to write query.... TableName: T1, Columns: EId, EName, MId select E1.EId as EmployeeId, E1.Ename as EmployeeName, E2.EName as ManagerName from T1 as E1, T1 as E2 where E1.MId = E2.EId

    • 0
  • Bhasker Das
    Jul, 2006 13

    Self join is just like any other join, except that two instances of the same table will be joined in the query. Here is an example: Employees table which contains rows for normal employees as well as managers. So, to find out the managers of all the employees, you need a self join.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS