title: SQL Query: Looking to calculate difference between two columns both in different tables?
body: <p>I'm looking to calculate the difference between the sum of two different columns in two different tables. Here's what I have:</p>
  
  <pre><code>SELECT sum(amount)
  FROM variable_in
  where user_id='111111'
  minus
  SELECT sum(amount)
  FROM variable_out
  where user_id='111111'
  </code></pre>
  
  <p>When I do this, I just get an output of the first query results. How do I have it execute both queries (for the in and out tables) as well as have it minus the variable_out total for the amount column? Since they are both going to be positive integers. </p>
  
  <p>Thanks in advance! Most of the other tips I've seen have been overly complex compared to my issue. </p>