0
我試圖運行一個查詢,它會將四捨五入的平均值顯示爲兩位小數。這是我的代碼,我不知道爲什麼我不斷收到錯誤。「缺少右括號」MySQL錯誤
SELECT
ROUND(AVG (Scholarship, 2)) AS 'Average Scholarships'
FROM
student;
我試圖運行一個查詢,它會將四捨五入的平均值顯示爲兩位小數。這是我的代碼,我不知道爲什麼我不斷收到錯誤。「缺少右括號」MySQL錯誤
SELECT
ROUND(AVG (Scholarship, 2)) AS 'Average Scholarships'
FROM
student;
SELECT ROUND(AVG (Scholarship), 2) AS 'Average Scholarships' FROM student;
你傳入Scholarship, 2
到AVG
功能,只期待一個參數。
你的意思做的是通過AVG (Scholarship)
和2
到ROUND
,像這樣:
SELECT ROUND(AVG (Scholarship), 2) AS 'Average Scholarships' FROM student;