MariaDB: FLOOR Function
This MariaDB tutorial explains how to use the MariaDB FLOOR function with syntax and examples.
Description
The MariaDB FLOOR function returns the largest integer value that is equal to or less than a number.
Syntax
The syntax for the FLOOR function in MariaDB is:
FLOOR( number )
Parameters or Arguments
- number
- The value used to find the largest integer value.
Note
- See also the ROUND, CEIL, CEILING, and TRUNCATE functions.
- See also the DIV function.
Applies To
The FLOOR function can be used in the following versions of MariaDB:
- MariaDB 10
Example
Let's look at some MariaDB FLOOR function examples and explore how to use the FLOOR function in MariaDB.
For example:
SELECT FLOOR(12.5); Result: 12 SELECT FLOOR(12.1); Result: 12 SELECT FLOOR(12); Result: 12 SELECT FLOOR(-12.7); Result: -13 SELECT FLOOR(-12.3); Result: -13 SELECT FLOOR(-12); Result: -12
Advertisements