title: Sum a column from a sum
body: <p>I am looking for a way to sum another amount from a summed column from within a SQL script.</p>
  
  <p>Making a simpler script</p>
  
  <pre><code>   SELECT c.customerName, b.bankName, sum(1) as ExceptionCount
      FROM  customer c INNER JOIN bank b on c.customerBranchId = 
  b.branchId
      INNER JOIN  exception e ON c.customerId = e.exceptionId
      GROUP BY b.bankName, customerName
      ORDER BY b.bankName, customerName
  </code></pre>
  
  <p>So if I run this and my results are something like:</p>
  
  <pre><code>BOB     bank1       17
  Sue     bank2       8
  Steve   bank3       12
  </code></pre>
  
  <p>What I am looking for is another column on this to SUM the exceptions by the CustomerName so it translates into</p>
  
  <pre><code>BOB bank1   17  3  &lt;-- This is the exceptionCount By CustomerName   
  Sue bank2   8   2   (that's what I am looking for)
  Steve   bank3   12  4
  </code></pre>