I want to limit the decimal of the average to 2..
SELECT grade.GStudNo, AVG(grade.Grade) 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
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
Would round it to two places.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With