title: How do I Union two tables with different columns
body: <p>I have Two Tables Called Table_A and Table_B like bellow.</p>
  
  <p><strong>Table_A</strong></p>
  
  <pre><code>+-------+------------+------+---------+-----+
  |MonthId|DepartmentId|Salary|Deduction| Paid|
  +-------+------------+------+---------+-----+
  |01/2016|    DEP01   | 1000 |     100 |  900|
  |01/2016|    DEP02   | 2000 |      50 | 1950|
  |01/2016|    DEP03   | 1500 |       0 | 1500|
  |       |            |      |         |     |
  |02/2016|    DEP01   | 1000 |     100 |  900|
  |02/2016|    DEP02   | 2000 |      50 | 1950|
  |02/2016|    DEP03   | 1500 |       0 | 1500|
  +-------------------------------------------+
  </code></pre>
  
  <p><strong>Table_B</strong></p>
  
  <pre><code>+-------+------------+------+---------+-----+------+------+
  |MonthId|DepartmentId|Salary|Deduction| Paid|Bank_1|Bank_2|
  +-------+------------+------+---------+-----+------+------+
  |01/2016|    DEP01   | 1000 |     100 |  900|  400 |  500 |
  |01/2016|    DEP02   | 2000 |      50 | 1950| 1400 |  550 |
  |01/2016|    DEP03   | 1500 |       0 | 1500|    0 | 1500 |
  +---------------------------------------------------------+
  </code></pre>
  
  <p>So When i try with </p>
  
  <pre><code>SELECT MonthId, DepartmentId, Salary, Deduction, Paid, Null AS Bank_1, Null AS Bank_2
  FROM Table_A 
  WHERE MonthId = '02/2016'
  
  UNION
  
  SELECT MonthId, DepartmentId, Salary, Deduction, Paid, Bank_1, Bank_2
  FROM Table_B 
  WHERE MonthId = '02/2016'
  </code></pre>
  
  <blockquote>
    <p>WHERE MonthId = '02/2016'</p>
  </blockquote>
  
  <p>im getting what i need but when if try with </p>
  
  <blockquote>
    <p>WHERE MonthId = '01/2016'</p>
  </blockquote>
  
  <p>Im getting bellow Result. so please help me to solve this problem.</p>
  
  <pre><code>+-------+------------+------+---------+-----+------+------+
  |MonthId|DepartmentId|Salary|Deduction| Paid|Bank_1|Bank_2|
  +-------+------------+------+---------+-----+------+------+
  |01/2016|    DEP01   | 1000 |     100 |  900| NULL | NULL |
  |01/2016|    DEP01   | 1000 |     100 |  900|  400 |  500 |
  |01/2016|    DEP02   | 2000 |      50 | 1950| NULL | NULL |
  |01/2016|    DEP02   | 2000 |      50 | 1950| 1400 |  550 |
  |01/2016|    DEP03   | 1500 |       0 | 1500| NULL | NULL |
  |01/2016|    DEP03   | 1500 |       0 | 1500|    0 | 1500 |
  +---------------------------------------------------------+
  </code></pre>