What is a self join in sql server

Total Post:341

 992  View(s)
Rate this:
I want to know Self join in sqlserver How to use It.please help me.
  1. Post:282

    Re: What is a self join in sql server

    A self join is basically when a table is joined to itself. The way you should visualize a self join for a given table is by imagining that a join is performed between two identical copies of that table. And that is exactly why it is called a self join – because of the fact that it’s just the same table being joined to anothercopy of itself rather than being joined with a different table.

    SELECT e1.Emp_ID,e1.Emp_Name,e1.Emp_Sal

    FROM employee e1, employee e2

    WHERE e1.Location = e2.Location

    AND e2.Location='allahabad'

      Modified On Apr-10-2018 06:27:02 AM
  1. Post:341

    Re: What is a self join in sql server

    self join is a join in which a table is joined with itself. For example, when you require details about an employee and his manager (also an employee)

      Modified On Apr-10-2018 06:27:12 AM