title: how to apply join on self table
body: <p>I have Emp table having 3 columns [EmpId], [EmpName], [MgrId]
  MgrId is foreign key of same Emp table and EmpId is primary key</p>
  <pre><code>EmpId   EmpName MgrId
  1       A       NULL
  2       B       1
  3       C       2
  4       D       3
  5       E       4
  </code></pre>
  <p>I need following output</p>
  <pre><code>EmpName MgrName
  A        
  B       A
  C       B
  D       C
  E       D
  </code></pre>
  <p>I am using following query but getting wrong output</p>
  <pre><code>SELECT E1.EmpName, E1.Empname as mgrName
  FROM Emp E1, Emp E2 
  WHERE E1.EmpId = E2.EmpId
  </code></pre>