title: calculating a percentage based on results from the query
body: <p>I currently run the query:</p>
  
  <pre><code>select table1.columnA as Barrier_1,
         table2.columnB as Action_1,
    from table2
    join table1 on table2.PrimKey = table1.PrimKey
   where table1.columnA is not null
     and table2.columnB is not null
   group by table1.columnA, table2.columnB
   order by table1.columnA
  </code></pre>
  
  <p>which returns the table:</p>
  
  <pre><code>Barrier_1   Action_1
  ____________________
     01     |    01
     01     |    02
     02     |    01
     02     |    03
     02     |    04
     03     |    02
     03     |    03
     04     |    01
     05     |    04
  </code></pre>
  
  <p>and what I want it to do is calculate the percentage of each action per barrier:</p>
  
  <pre><code>Barrier_1   Action_1   Percent_1
  ________________________________
     01     |    01    |   60%
     01     |    02    |   40%
     02     |    01    |   20%
     02     |    03    |   10%
     02     |    04    |   70%
     03     |    02    |   20%
     03     |    03    |   80%
     04     |    01    |  100%
     05     |    04    |  100%
  </code></pre>
  
  <p>Note that each action can show up multiple time per barrier.</p>
  
  <p>So each barrier has it's own set of actions. For example, barrier one can have a total of 5 actions (2 being action 02 and 3 being action 01).</p>