Adding new rows with SQL to an Access table with GROUP BY? -
i have table in access database looks (r1, r2, etc column names).
r1 r2 r3 r4 r5 r6 4 8 1 1 1 90,0680360218135 4 8 1 1 2 100 4 8 1 1 3 72,0756369473476 4 8 1 1 4 68,9391913253478 4 8 1 1 5 61,6543424488292 4 8 1 1 6 69,904486251809 4 8 1 1 7 47,0347033309303 4 8 1 1 8 76,3784417080973 4 8 1 1 9 33,3333333333333 1 8 1 1 1 74,1004658877797 1 8 1 1 2 97,7238166791886 1 8 1 1 3 82,1876261841859 1 8 1 1 4 68,1693097727754 1 8 1 1 5 67,71399360198 1 8 1 1 6 47,5141142738908 1 8 1 1 7 44,8295982097869 1 8 1 1 8 82,6223931742496 1 8 1 1 9 33,3333333333333 3 8 1 1 1 85,5250502810347 3 8 1 1 2 100 3 8 1 1 3 78,5248764773228 3 8 1 1 4 63,6806936758504 3 8 1 1 5 60,0848342976394 3 8 1 1 6 49,4890311068566 3 8 1 1 7 94,7562947232155 3 8 1 1 8 75,0063074448055 3 8 1 1 9 33,3333333333333 2 8 1 1 1 87,5227436005474 2 8 1 1 2 100 2 8 1 1 3 71,4484095690093 2 8 1 1 4 74,7733960793208 2 8 1 1 5 58,8799667344218 2 8 1 1 6 0 2 8 1 1 7 46,9028765060477 2 8 1 1 8 62,8187560467823 2 8 1 1 9 33,3319434019959
i want add 9 new rows table follows:
- r1 5 in new columns
- r2, r3 , r4 stay same (8, 1, 1)
- r5 different in each new row (1 9)
- r6 average function of r6 in 4 different rows
for example, want first 2 rows be
5 8 1 1 1 84,30... 5 8 1 1 2 99,43...
r6 column have value of average function of r6 values r1 1,2,3 , 4 each r5 (1 9). in previous row example (new row 1) value of r6 (90,06 + 74,10 + 85,52 + 87,52) / 4) = 84,30.
i've tried sql group i'm not getting result or i'm doing wrong. know sql statement correct add 9 new rows?
Comments
Post a Comment