i have employee table as follows
Empid Name Mgrid Designation Salary
1 John Null Developer 15000
2 John 1 Programmer 15000
3 Joe 1 Developer 25000
4 Peter 3 Developer 35000
I want the ouput as follows
To get the below output how to write the query in sql server using self join
EmpName Manage rname
John Null
John John
Joe John
Peter Joe