I am starting to learn MYSQL and have an issue at hand that I cannot figure out. My table looks like this:
OU Date Amt
A20 201701 1000
A20 201705 1000
A20 201708 1000
B10 201702 1000
B10 201705 1000
What I would like is to calculate the YTD amount for each row by OU that looks like this:
OU Date Amt YTD
A20 201701 1000 1000
A20 201705 1000 2000
A20 201708 1000 3000
B10 201702 1000 1000
B10 201705 1000 2000
I tried different sum and sumif functions but couldn't get the correct results. Can anyone help? Any input is much appreciated!