Reputation: 69
SELECT Forename, test1, test2, test3, test4, ((test1+test2+test3+test4)/4) AS aMark
FROM Question1
GROUP BY Forename, test1, test2, test3, test4
ORDER BY aMark ASC;
I am trying to calculate the average of 4 test marks, but when I execute my code it comes up with a message saying to enter parameter value for 'aMark', would anyone be able to explain why and how I would fix this?
Upvotes: 1
Views: 52
Reputation: 36840
You can also use below query
SELECT Question1.*, ((test1+test2+test3+test4)/4) AS aMark
FROM Question1
ORDER BY ((test1+test2+test3+test4)/4) ASC;
Upvotes: 1