Example :
Source columns are fld_daily_val, fld_date
Table Name : tbl_five_days_avg
id fld_daily_val fld_date
1 3.3658974569 2016-02-01
2 2.215478659 2016-02-02
3 1.25984453412 2016-02-03
4 0.2589631477 2016-02-04
5 9.2587894561 2016-02-05
6 7.2587415935 2016-02-06
7 6.589789789 2016-02-07
8 5.3654951357 2016-02-08
Output Column name is fld_five_days_avg. We want the output's are the following
id fld_daily_val fld_date fld_five_days_avg
1 3.3658974569 2016-02-01 3.3658974569 --No data before this date.
2 2.215478659 2016-02-02 2.79068805795000 --id(1+2)/2
3 1.25984453412 2016-02-03 2.280406883340000 --id(1+2+3)/3
4 0.2589631477 2016-02-04 1.775045949430000 --id(1+2+3+4)/4
5 9.2587894561 2016-02-05 3.271794650764000 --id(1+2+3+4+5)/5
6 7.2587415935 2016-02-06 7.2587415935 --should consider this is the first record after five record average completed.
7 6.589789789 2016-02-07 6.92426569125000 --id(6+7)/2
8 5.3654951357 2016-02-08 6.40467550606667 --id(6+7+8)/3
help us to improve the knowledge. Thanks in advance
Thanks,