title: How to use minus operator correctly?
body: <p>For some reason the below query only returns the sum(amount) from the first query, not the intended difference between the first sum(amount) and the second sum(amount).</p>
  
  <pre><code>select sum(amount) from(
  SELECT  
          UNIQUE_MEM_ID ,
          Amount
  
  FROM    yi_fourmpanel.card_panel
  WHERE (DESCRIPTION iLIKE '%some criteria%')
  
  
  GROUP BY 
           UNIQUE_MEM_ID ,
           Amount)
  
      minus
  
  select sum(amount) from(
  SELECT  
          UNIQUE_MEM_ID ,
          Amount
  
  FROM    yi_fourmpanel.card_panel
  WHERE (DESCRIPTION iLIKE '%some criteria%')
  
  AND is_duplicate!=1
  AND amount &gt;0
  AND currency_id = 152
  AND transaction_base_type = 'debit'
  
  GROUP BY 
           UNIQUE_MEM_ID ,
           Amount)
  </code></pre>