title: SQL ROLLUP or Union?
body: <p>I am trying to get the grand total number of entries but unfortunately I am not convinced rollup would be the best choice:</p>
  
  <pre><code>SELECT BUSINESS_STATUS_NAME,
    PENDING_ITEMS,
    DATAGROUP
  FROM PAYMENTS
  WHERE STATUS LIKE '%PROCESS%';
  </code></pre>
  
  <p>This Produces:</p>
  
  <pre><code>BUSINESS_STATUS_NAME     PENDING_ITEMS     DATAGROUP
  PROCESSING DATA          34                PRODUCT
  PROCESSING INS           40                SERVICE
  </code></pre>
  
  <p>I would like to get a Grand Total below, but ROLLUP is giving me subtotals because it includes the datagroup column. I just need the Grand total for the pending items but yet I need to display the datagroup. Would it be better to UNION with a sum(pending_items) select query?</p>
  
  <pre><code>BUSINESS_STATUS_NAME     PENDING_ITEMS     DATAGROUP
  PROCESSING DATA          34                PRODUCT
  PROCESSING INS           40                SERVICE
  GRAND TOTAL **           74
  </code></pre>
  
  <p>Thank you!</p>