title: SQL sum grouped by field with all rows
body: <p>I have this table:</p>
  
  <pre><code>id  sale_id  price
  -------------------
  1     1       100
  2     1       200
  3     2       50 
  4     3       50
  </code></pre>
  
  <p>I want this result:</p>
  
  <pre><code>id  sale_id  price  sum(price by sale_id)
  ------------------------------------------
  1     1       100    300
  2     1       200    300
  3     2       50      50
  4     3       50      50
  </code></pre>
  
  <p>I tried this:</p>
  
  <pre><code>SELECT id, sale_id, price, 
  (SELECT sum(price) FROM sale_lines GROUP BY sale_id) 
  FROM sale_lines
  </code></pre>
  
  <p>But get the error that subquery returns different number of rows.
  How can I do it? </p>
  
  <p>I want all the rows of sale_lines table selecting all fields and adding the sum(price) grouped by sale_id.</p>