I have the following SQL where I display the total by month:
select to_char(tanggal, 'mm') as month,
sum(nilai) as realisasi
from
tbl_pasar_dini
where (date_part('year', tanggal)= extract(year from timestamp 'NOW()'))
group by 1
and this is the result:
| month | realisasi |
|---|---|
| 01 | 2000 |
| 02 | 900 |
| 03 | 3000 |
| 04 | 200 |
| 05 | 5000 |
| 06 | 100 |
How do I make the total accumulate, so that each month the value increases from the previous month