title: Need to sum two columns from two tables, separately, based on products in table 3
body: <p>I have three tables.<br>
  Table 1: Product mapping table,<br>
  Table 2: FY12 Sales Numbers,<br>
  Table 3: FY13 Sales Numbers. </p>
  
  <p>Basically, I want the end result to be three columns: Product, FY12 Qty, FY13 Qty. </p>
  
  <p>Right now I join the Product Mapping table to the Two Sales tables. If I do this one sales table at a time I get the right numbers. As soon as I try to get the sum from the other table the numbers are all off. </p>
  
  <p>Here is the code that works for getting quantity from one table, but I can't figure out how to get another column in the result that sums the same product groupings from another table.</p>
  
  <pre><code>select PRODUCT_MAPPING.PRODUCT_FAMILY as PRODUCT_FAMILY,
      PRODUCT_MAPPING.PRODUCT_CONFIG as PRODUCT_CONFIG,
      sum(CURRENTWEEK_PIPE.FY13_QUANTITY) as FY13_QUANTITY 
   from PRODUCT_MAPPING PRODUCT_MAPPING,
      CURRENTWEEK_PIPE CURRENTWEEK_PIPE 
   where CURRENTWEEK_PIPE.PRODUCT_ITEM=PRODUCT_MAPPING.PRODUCT_ITEM
      and PRODUCT_MAPPING.PRODUCT_CONFIG is not null
   group by PRODUCT_MAPPING.PRODUCT_FAMILY, PRODUCT_MAPPING.PRODUCT_CONFIG
   order by PRODUCT_MAPPING.PRODUCT_FAMILY ASC, PRODUCT_MAPPING.PRODUCT_CONFIG ASC
  </code></pre>