SELECT FLOOR(80.41); -- 80
Floor MySQL function returns the largest integer that is not greater than the input value. This can be easily understood by some examples.
SELECT FLOOR(5.89); -- 5
SELECT FLOOR(5.22); -- 5
SELECT FLOOR(-5.89); -- -6
SELECT FLOOR(-5.12); -- -6
As you can see in above command gives largest integer that is not greater than the input value.
SELECT AVG(mark) AS avg_mark FROM student;
Output = 74.6571 SELECT FLOOR(AVG(mark)) AS avg_mark FROM student;
Output = 74Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.
| kathir | 07-06-2012 |
| Thanks for your kind work | |