title: Self Join to get employee manager name
body: <p>Hello I have a Employee Table with following columns</p>
  
  <pre><code>Emp_id, Emp_Name and Mgr_id.
  </code></pre>
  
  <p>I am trying to create a view which will list </p>
  
  <p><code>Emp_id, Emp_name, Mgr_id and Mgr_name</code> (by cross joining the Employee table). I tried outer join, inner join etc, but I am not able to get it right. </p>
  
  <p>Any help is highly appreciated.</p>
  
  <pre><code>CREATE TABLE [dbo].[tblEmployeeDetails](
  [emp_id] [bigint] NOT NULL, 
  [emp_name] [nvarchar](200) NULL,    
  [emp_mgr_id] [bigint] NULL, CONSTRAINT [PK_tblEmployeeDetails] PRIMARY KEY CLUSTERED (
  [emp_id] ASC )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY] ) ON [PRIMARY]
  </code></pre>