title: MySQL sum of table sums with different where clauses
body: <p>Trying to sum multiple sums from different tables with different where conditions for each table.</p>
  
  <p>Here's my 3 sums:</p>
  
  <pre><code>SELECT SUM(1column2) FROM table1 WHERE 1column1 = '0';
  SELECT SUM(1column4) FROM table1 WHERE 1column3 = '0';
  SELECT SUM(2column2) FROM table2 WHERE 2column1 = '0' AND 2column3 = 'w' AND 2column4 != 'f';
  </code></pre>
  
  <p>The result needs to be <code>(first sum) - (second sum) - (third sum)</code>.</p>