Reputation: 101
I am trying to run a query that will show the rounded average to two decimal places. This is my code and I don't know why I keep getting the error.
SELECT
ROUND(AVG (Scholarship, 2)) AS 'Average Scholarships'
FROM
student;
Upvotes: 0
Views: 671
Reputation: 10665
You are passing Scholarship, 2
to the AVG
function, which only expects one argument.
What you meant to do was pass AVG (Scholarship)
and 2
to ROUND
, like this:
SELECT ROUND(AVG (Scholarship), 2) AS 'Average Scholarships' FROM student;
Upvotes: 3
Reputation: 16677
SELECT ROUND(AVG (Scholarship), 2) AS 'Average Scholarships' FROM student;
Upvotes: 1