title: Inserting Sum of 2 tables into a row
body: <p>I would like to store in a row of a 'Totals' table the sum calculated from 2 other tables.</p>
  
  <p>I want to use a column for each table.</p>
  
  <p>I tried the following:</p>
  
  <pre>
  INSERT INTO Totals
  (
      Date,
      FirstTableSum,
      SecondTableSum
  )
  
  SELECT 
      '2010/01/31',
      SUM( t.Data1 ),
      SUM( v.Data2 )
  FROM
      FirstTable as t,
      SecondTable as v
  WHERE 
      t.Date = '2010/01/31'
  AND v.Date = '2010/01/31'
  </pre>
  
  <p>If I make a query to check the sums of the 2 distinct tables I have different values.</p>
  
  <pre>
  SELECT SUM(Data1) FROM FirstTable WHERE Date='2010/01/31'
  /*The result is different from FirstTableSum: Why?*/
  
  SELECT SUM(Data2) FROM SecondTable WHERE Date='2010/01/31'
  /*The result is different from SecondTableSum Why?*/
  </pre>
  
  <p>What am I doing wrong?</p>
  
  <p>Thanks</p>