I have a table (SQL Server 2005) of this format:
dummy_id, date_registered, item_id, quantity, price
and I want to add a new column (cumulative) which calculates the cumulative totals of each item_id order by date_registered as shown:
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
Thanx in advance