![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi everybody.I'm Facing a ploblem to calculate running average.I am explaining the scenario. In my table there are three column only 1.col1 2.col2 3.col3 In my query what to show another column with running average of previous 5 Rows.Is it possible through query? Example ------- My table already contains Col1 Col2 Col3 ---- ---- ----- 1 a 2 2 b 4 3 c 6 4 d 8 5 e 10 6 f 12 7 g 14 8 h 20 9 i 2 In my query output I want to show the data like this format Col1 Col2 Col3 Col4 ---- ---- ------ ------ 1 a 2 0 2 b 4 0 3 c 6 0 4 d 8 0 5 e 10 6---Average first 5 rows(1-5) 6 f 12 8---Average next 5 rows(2-6) 7 g 14 10--Average next 5 rows(3-7) 8 h 20 12--Average next 5 rows(4-8) 9 i 2 11--Average next 5 rows(5-9) hope it will be clear to all of you.If any problem in understanding please let me inform. Thanks Arijit Chatterjee |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Col1 Col2 Col3 Col4 ---- ---- ------ ------ 1 a 2 0 2 b 4 0 3 c 6 0 4 d 8 0 5 e 10 6---Average first 5 rows(1-5) 6 f 12 8---Average next 5 rows(2-6) 7 g 14 10--Average next 5 rows(3-7) 8 h 20 12--Average next 5 rows(4-8) 9 i 2 11--Average next 5 rows(5-9) hope it will be clear to all of you.If any problem in understanding please let me inform. Thanks Arijit Chatterjee |
#5
| |||
| |||
|
|
Hi everybody.I'm Facing a ploblem to calculate running average.I am explaining the scenario. In my table there are three column only 1.col1 2.col2 3.col3 In my query what to show another column with running average of previous 5 Rows.Is it possible through query? Example ------- My table already contains Col1 Col2 Col3 ---- ---- ----- 1 a 2 2 b 4 3 c 6 4 d 8 5 e 10 6 f 12 7 g 14 8 h 20 9 i 2 In my query output I want to show the data like this format Col1 Col2 Col3 Col4 ---- ---- ------ ------ 1 a 2 0 2 b 4 0 3 c 6 0 4 d 8 0 5 e 10 6---Average first 5 rows(1-5) 6 f 12 8---Average next 5 rows(2-6) 7 g 14 10--Average next 5 rows(3-7) 8 h 20 12--Average next 5 rows(4-8) 9 i 2 11--Average next 5 rows(5-9) hope it will be clear to all of you.If any problem in understanding please let me inform. Thanks Arijit Chatterjee |
#6
| |||
| |||
|
|
Hi everybody.I'm Facing a ploblem to calculate running average.I am explaining the scenario. In my table there are three column only 1.col1 2.col2 3.col3 In my query what to show another column with running average of previous 5 Rows.Is it possible through query? Example ------- My table already contains Col1 Col2 Col3 ---- ---- ----- 1 a 2 2 b 4 3 c 6 4 d 8 5 e 10 6 f 12 7 g 14 8 h 20 9 i 2 In my query output I want to show the data like this format Col1 Col2 Col3 Col4 ---- ---- ------ ------ 1 a 2 0 2 b 4 0 3 c 6 0 4 d 8 0 5 e 10 6---Average first 5 rows(1-5) 6 f 12 8---Average next 5 rows(2-6) 7 g 14 10--Average next 5 rows(3-7) 8 h 20 12--Average next 5 rows(4-8) 9 i 2 11--Average next 5 rows(5-9) hope it will be clear to all of you.If any problem in understanding please let me inform. Thanks Arijit Chatterjee |
![]() |
| Thread Tools | |
| Display Modes | |
| |