This tutorial explains how to use the MySQL CEILING function with syntax and examples.
The MySQL CEILING function returns the smallest integer value that is greater than or equal to a number.
The syntax for the CEILING function in MySQL is:
CEILING( number )
The value used to find the smallest integer value.
The CEILING function can be used in the following versions of MySQL:
Let's look at some MySQL CEILING function examples and explore how to use the CEILING function in MySQL.
For example:
mysql> SELECT CEILING(32.65);
Output: 33
mysql> SELECT CEILING(32.1);
Output: 33
mysql> SELECT CEILING(32);
Output: 32
mysql> SELECT CEILING(-32.65);
Output: -32
mysql> SELECT CEILING(-32.1);
Output: -32
mysql> SELECT CEILING(-32);
Output: -32