I have a table called Request and the data looks like:
Req_ID R1 R2 R3 R4 R5
R12673 2 5 3 7 10
R34721 3 5 2 1 8
R27835 1 3 8 5 6
Now I want to display the average of R1,R2,R3,R4 and R5
So I wrote a query like:
Select Req_ID, Avg(R1+R2+R3+R4+R5) as Average
from Request
Group by Req_ID
But I just get the sum of R1,R2,R3,R4 and R5 not the average? Where am I doing wrong.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…