ghx8 icon

runsum

ghx8 | PRO | 03/28/18 08:35:13 AM UTC | 0 ⭐ | 225 👁️ | Never ⏰ | []
T-SQL |

290 B

|

None

|

0 👍

/

0 👎

select date, sum(amount), sum(sum(amount)) over (order by date) from
(select ref date,amount, amount amtmx, 0 amtrk from rk where ctg='str' and db='01nrg' and ref is not null
union all select date,-amount, 0, amount amtrk from rk where ctg='str' and db='01nrg' and ref is not null) t
group by date

Comments