title: SQL - Join multiple table
body: <p>I have four tables <code>Customer</code>, <code>Sales</code>, <code>Invoice</code>, and <code>Receipt</code>.</p>
  
  <h2>Customer</h2>
  
  <pre><code>ID      Name
  1         A
  </code></pre>
  
  <h2>Sales</h2>
  
  <pre><code>ID     Name
  1      Ben
  </code></pre>
  
  <h2>Invoice</h2>
  
  <pre><code>ID     Amt      Date         CustomerID       SalesID
  1      12       1/9/2014       1                 1
  2      10       1/10/2014      1                 1
  3      20       2/10/2014      1                 1
  4      30       3/10/2014      1                 1
  </code></pre>
  
  <h2>Receipt</h2>
  
  <pre><code>ID     Amt      Date         CustomerID       SalesID
  1      10       4/10/2014        1               1
  </code></pre>
  
  <p>I wish to join those 4 table as below with sum up the Ammount(s), but I am stuck as to how I can achieve my desired</p>
  
  <h2>RESULT</h2>
  
  <pre><code>CustomerID         SalesID         Inv_Amt       Rep_Amt       Month  
     1                  1               12            0            9
     1                  1               60            10           10
  </code></pre>
  
  <p>I've been stuck for days. But, I have no idea how to proceed.</p>