title: Display all subtotals and a single total for every bill
body: <p>I have a query with this result:</p>
  
  <pre><code>billno painter_id painter_rate painter_subtotal sum_1
  2      2          5            30               30
  7      2          20           160              255
  7      2          20           80               255
  7      2          5            15               255
  </code></pre>
  
  <p>Using the following SQL:</p>
  
  <pre><code>SELECT a1.billno, a1.painter_id, a1.painter_rate, 
      a1.painter_subtotal, a2.painter_subtotal AS sum_1 
  FROM voucher_paint_detail AS a1 LEFT OUTER JOIN 
      (SELECT billno,sum(painter_subtotal) AS painter_subtotal 
      FROM voucher_paint_detail where painter_id='BMLWA' GROUP BY billno) AS a2
  ON a2.billno = a1.billno
  WHERE a1.painter_id = '2'
  </code></pre>
  
  <p>on this table:</p>
  
  <pre><code>CREATE TABLE [voucher_paint_detail] (
      [srno] INTEGER NULL,
      [painter_id] TEXT NULL,
      [painter_rate] REAL NULL,
      [paint_quantity] INTEGER NULL,
      [painter_subtotal] REAL NULL,
      [transaction_id] INTEGER NULL,
      PRIMARY KEY ([srno])
  )
  </code></pre>
  
  <p>i want the the data to look like</p>
  
  <pre><code>billno painter_id painter_rate painter_subtotal sum_1
  2      2          5            30               30
  7      2          20           160   
  7      2          20           80    
  7      2          5            15               255
  </code></pre>