title: SQL server full join query
body: <p>I have a full join sql query and i am retrieving the data from the same table.the problem is i am getting the null value where i am expecting the column name.</p>
  
  <p>Example:
  I am having a table where there are two columns typeOfPost,dob.</p>
  
  <pre><code>DOB               TypeOfPost
  ---------      --------------
  20/11/1998      Manager
  1/1/2000         Sales
  13/6/1999         Manager
  20/1/1987         Manager
  1/11/1985         Sales
  </code></pre>
  
  <p>Now when I am writing a join query like</p>
  
  <pre><code>select DATENAME(month,dob) as Red,count(TypeOfPost) 
  from tablename
  where TypeOfPost='Manager'
  group by DATENAME(month,dob) as A
  
  
  
  full join
  
  select DATENAME(month,dob) as Green,count(TypeOfPost) 
  from tablename
  where TypeOfPost='Sales'
  group by DATENAME(month,dob) as B on B.Green = A.Red
  
  
  
  Output--                                                Expected Output--
  ---------------------                           ---------------------
  Month      Man      Sal                           Month      Man      Sal
  --------   -----   ------                        --------   -----   ------
  January      1         1                              January      1         1
  NULL         1         NULL                           June         1         NULL
  November   1         1                              November   1         1
  </code></pre>
  
  <p>Now here the problem rise, I want 'June' in the column Month instead of NULL value.
  So is there any way to get that??
  Help me out. 
  Thanks.</p>