title: SQL Full Outer Join with Multiple Tables
body: <p>First I have 4 Tables</p>
  
  <pre>
  Table0, Columns: num, desc
  Table1, Columns: num, qty1
  Table2, Columns: num, qty2
  Table3, Columns: num, qty3
  Table4, Columns: num, qty4
  </pre>
  
  <p>(not all num have values in qty1 or qty2 or qty3 or qty4, therefore I need a full join)
  and my query:</p>
  
  <pre><code>SELECT Table0.num, SUM(Table1.qty1 ), SUM(Table2.qty2 ), SUM(Table3.qty3 ), SUM(Table4.qty4)
  FROM Table0
  FULL OUTER JOIN Table1 ON Table0.num = Table1.num
  FULL OUTER JOIN Table2 ON Table0.num = Table2.num
  FULL OUTER JOIN Table3 ON Table0.num = Table3.num
  FULL OUTER JOIN Table4 ON Table0.num = Table4.num
  GROUP BY Table0.num
  </code></pre>
  
  <p>Somehow its returning just 1 row of data:</p>
  
  <pre>
  num | qty1 | qty2 | qty3 | qty4 |
  ---------------------------------
      | 100  | 20   |  77  |  969 |
  </pre>
  
  <p>But I was expecting like the example at</p>
  
  <p><a href="http://www.w3schools.com/sql/sql_join_full.asp" rel="nofollow">http://www.w3schools.com/sql/sql_join_full.asp</a></p>
  
  <p>like:</p>
  
  <pre>
  num | qty1 | qty2 | qty3 | qty4 |
  ---------------------------------
  1   |   0  |  2   |  3   |   2  |
  2   |   1  |  0   |  0   |   0  |
  3   |   7  |  0   |  9   |   0  |
  4   |   0  |  0   |  0   |  10  |
  5   |   0  |  0   |  7   |   0  |
  6   |   8  |  2   |  9   |   3  |
  7   |   0  |  1   |  0   |   0  |</pre>
  
  <p>(I don't know this solves it)
  However I got similar to the result the box above by changing all the tables to:</p>
  
  <pre>
  Table1, Columns: num, qty1, qty2, qty3, qty4
  Table2, Columns: num, qty2, qty1, qty3, qty4
  Table3, Columns: num, qty3, qty1, qty2, qty4 
  Table4, Columns: num, qty4, qty1, qty2, qty3 </pre>