title: How to add a 'total' row in a grouped query (in Postgresql)?
body: <p>How do I add a row to the end of this SELECT so I can see the total of the grouped rows? (I need the total for 'money' and 'requests':</p>
  
  <pre><code>SELECT 
      organizations.name || ' - ' || section.name as Section, 
      SUM(requests.money) as money, 
      COUNT(*) as requests
  FROM 
      schema.organizations
     -- INNER JOINs omitted --
  WHERE 
      -- omitted --
  GROUP BY 
      -- omitted --
  ORDER BY 
      -- omitted --
  </code></pre>
  
  <p>Running the above produces:</p>
  
  <pre><code>|*Section*  | *Money* | *Requests*|
  |-----------|---------|-----------|
  |BMO - HR   |564      |10         |
  |BMO - ITB  |14707    |407        |
  |BMO - test |15       |7          |
  </code></pre>
  
  <p>Now what I want is to add a total to the end of that which would display:</p>
  
  <pre><code>|BMO - Total|15286    |424        |
  </code></pre>
  
  <hr>
  
  <p>I have tried a few things, and ended up by trying to wrap the select in a WITH statement and failing:</p>
  
  <pre><code>WITH w as (
      --SELECT statement from above--
  )
  SELECT * FROM w UNION ALL 
     SELECT 'Total', money, requests from w
  </code></pre>
  
  <p>This produces weird results (I'm getting four total rows - when there should be just one.</p>
  
  <p>Any help would be much appreciated!</p>
  
  <p>Thanks</p>