Mysql Ceil Function

MySQL: CEIL Function

This tutorial explains how to use the MySQL CEIL function with syntax and examples.


The MySQL CEIL function returns the smallest integer value that is greater than or equal to a number.


The syntax for the CEIL function in MySQL is:

CEIL( number )

Parameters or Arguments


The value used to find the smallest integer value.


Applies To

The CEIL function can be used in the following versions of MySQL:

  • MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0.6


Let's look at some MySQL CEIL function examples and explore how to use the CEIL function in MySQL.

For example:

mysql> SELECT CEIL(32.65);
Output: 33

mysql> SELECT CEIL(32.1);
Output: 33

mysql> SELECT CEIL(32);
Output: 32

mysql> SELECT CEIL(-32.65);
Output: -32

mysql> SELECT CEIL(-32.1);
Output: -32

mysql> SELECT CEIL(-32);
Output: -32