Calculate running total per month
<p>Let's say I have this table:</p>

<pre><code>id; date; units
1; Jan 1; 1
2; Jan 2; 4
3; Feb 9; 6
4; Mar 1; 1
5; Mar 4; 2
</code></pre>

<p>How can I now calculate the "accumulated_month" column accordingly? The calculation should start anew with every new month.</p>

<pre><code>id; date; units; accumulated_month
1; Jan 1; 1; 1
2; Jan 2; 4; 5
3; Feb 9; 6; 6
4; Mar 1; 1; 1
5; Mar 4; 2; 3
</code></pre>

<p>All I manage to get is this:</p>

<pre><code>id; date; units; accumulated_month
1; Jan 1; 1; 5
2; Jan 2; 4; 5
3; Feb 9; 6; 6
4; Mar 1; 1; 3
5; Mar 4; 2; 3
</code></pre>