title: UPDATE with SUM() in MySQL
body: <h3>My table:</h3>
  <pre>
  ID  NAME COST  PAR  P_val  S_val
  1   X    5     0    1      0
  1   y    5     0    2      0
  1   z    5     0    0      5
  2   XY   4     0    4      4
  </pre>
  <p>I need to update the <code>PAR</code> field with the <code>SUM(S_val)</code>, grouped by ID:</p>
  <ul>
  <li>For ID 1 <code>PAR</code> should be <code>SUM(SVAL) WHERE ID=1</code></li>
  <li>For ID 2 <code>PAR</code> should be <code>SUM(SVAL) WHERE ID=2</code></li>
  </ul>
  <h3>Expected ouput:</h3>
  <pre>
  ID  NAME COST PAR  P_val  S_val
  1   X    5     5   1      0
  1   y    5     5   2      0
  1   z    5     5   0      5     
  2   XY   4     4   4      4
  </pre>
  <p>How can I <code>UPDATE</code> the <code>PAR</code> value?</p>
  <h3>My code:</h3>
  <pre><code>UPDATE Table_Name SET PAR = (SELECT SUM(S_val) FROM Table_Name WHERE ID=1) 
  FROM   Table_Name
  </code></pre>
  <p>This does not work.</p>