title: How to refer to rollup summary row in normal rows
body: <p>I'd like to calculate the percentage of a column value compared to the sum of the lowest level rollup category in a query. For this, I would need to pre-reference the rolled up sum in normal rows. Is this possible? <a href="http://sqlfiddle.com/#!9/3ccf9/2" rel="nofollow" title="SQLFiddle">SQLFiddle</a></p>
  
  <p>Simple example table and data:</p>
  
  <pre><code>create table test
    (category1 integer,
     category2 integer,
     amount double);
  
  insert into test values
     (1,1,300),
     (1,1,400),
     (1,2,200),
     (1,2,500),
     (1,2,100),
     (2,1,300),
     (2,2,200),
     (2,2,500);
  </code></pre>
  
  <p>Querying the data with rollup:</p>
  
  <pre><code>select category1, category2, sum(amount) from test group by category1, category2 with rollup;   
  
  category1   category2   sum(amount)
  1           1           700
  1           2           800
  1           (null)      1500
  2           1           300
  2           2           700
  2           (null)      1000
  (null)      (null)      2500
  </code></pre>
  
  <p>Result I like to achieve:</p>
  
  <pre><code>category1   category2   sum(amount)  percent
  1           1            700          46.6   -- 700/1500*100
  1           2            800          53.3   -- 800/1500*100
  1           (null)      1500         100.0
  2           1            300          30.0   -- 300/1000*100
  2           2            700          70.0   -- 700/1000*100
  2           (null)      1000         100.0
  (null)      (null)      2500         (doesn't matter)
  </code></pre>