Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

Como posso fazer com que as casas decimais da função AVG no sql limitem apenas 2?

SELECT grade.GStudNo, ROUND( AVG(grade.Grade),2 ) AS Average, students.LName, students.FName, students.MName, students.Course
FROM students INNER JOIN grade ON students.StudNo = grade.GStudNo
WHERE GSem = '$sem' AND GYear = '$year'
GROUP BY grade.GStudNo
ORDER BY Average ASC LIMIT 3

Arredondaria para dois lugares.