title: How to use SUM in this situation?
body: <p>I have the following tables below and their schema: </p>
  
  <p>INV</p>
  
  <p><code>id, product code, name, ucost, tcost, desc, type, qoh</code></p>
  
  <pre><code>1,123,CPASS 700,1.00,5.00,CPASS 700 Lorem, COM,5
  2,456,Shelf 5,2.00,6.00,Shelf 5 KJ, BR,3
  </code></pre>
  
  <p>GRP</p>
  
  <p><code>id,type,desc</code></p>
  
  <pre><code>1,COM,COMPASS
  2,BR,SHELF 
  </code></pre>
  
  <p>Currently I have a query like this: </p>
  
  <pre><code>SELECT INV.*,GRP.DESCR AS CATEGORY 
  FROM INV LEFT JOIN GRP ON INV.TYPE = GRP.TYPE 
  WHERE INV.QOH = 0
  </code></pre>
  
  <p>There is no problems with that query.</p>
  
  <p>Right now,I want to know the SUM of the TCOST of every INV record where their QOH is 0. </p>
  
  <p>In this situation, does that I mean all I have to do is to write a separate query like the one below:  </p>
  
  <pre><code>SELECT SUM(TCOST)
  FROM INV
  WHERE QOH = 0 
  </code></pre>
  
  <p>Does it make any sense for me to try and combine those two queries as one ? </p>