I want to calculate cumulative column. The result i want it's in 2nd table in column "Cumul_result".
I have this table :
I want to calculate Running total group by article.
For exemplace te result will be :
I try this request bu it's not work :
select Article,
Year,
Quantity ,
Sum(Quantity) over ( order by Year) as Cumul_result
FROM TABLE;
Can you help me please ? Thanks
You are almost correct, all you need to do is partition by
Article:
select Article,
Year,
Quantity ,
Sum(Quantity) over (partition by Article order by Year) as Cumul_result
FROM mytable;