Assume there is a table comprises 3 rows:
date num
05-01 1
05-02 2
05-03 3
Then,calculate its 3-day moving average using new values. For example:
1st result = (1+2+3)/3=2
2nd result = (2+3+2)/3=2.33
3rd result = (3+2+2.33)/3=2.43
4th result = (2+2.33+2.43)/3=2.25
5th result = (2.33+2.43+2.25)/3=2.34
....till the 30th result
Is is possible to implement this in SQL? Any help will be appreciated.