SQLite ceil() Function

The SQLite ceil() function returns the smallest integer value greater than or equal to the number specified by the parameter.

The ceil() function and the ceiling() function are exactly the same.

Syntax

Here is the syntax of the SQLite ceil() function:

ceil(numeric_value)

Parameters

numeric_value

Required. A number, it can be positive, negative, or zero, it can be an integer or a decimal.

Return value

The SQLite ceil() function returns the smallest integer value greater than or equal to the number specified by the parameter.

The SQLite ceil() function will return NULL if the parameter is NULL.

If you provide a parameter that is not a number, the ceil() function will return NULL.

Examples

This example shows the basic usage of the SQLite ceil() function:

SELECT
    ceil(0),
    ceil(10),
    ceil(10.11),
    ceil(-10.11);
     ceil(0) = 0
    ceil(10) = 10
 ceil(10.11) = 11.0
ceil(-10.11) = -10.0

If you use a parameter that is not a number, the ceil() function will return NULL.

SELECT ceil('abc');
ceil('abc') =