title: SQL Server Cumulative Sum by Group
body: <p>I have a table (SQL Server 2005) of this format:</p>
  
  <p><strong>dummy_id,  date_registered,  item_id,  quantity,  price</strong></p>
  
  <p>and I want to add a new column (<strong>cumulative</strong>) which calculates the cumulative totals of each item_id order by date_registered as shown:</p>
  
  <pre><code>dummy_id  date_registered  item_id  quantity    price   cumulative
  
  1           2013-07-01        100      10        34.5       10
  
  2           2013-07-01        145       8        2.3         8
  
  3           2013-07-11        100      20        34.5       30
  
  4           2013-07-23        100      15        34.5       45
  
  5           2013-07-24        145      10        34.5       18
  </code></pre>
  
  <p>Thanx in advance</p>