SQLite ceiling() Function

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

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

Syntax

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

ceiling(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 ceiling() function returns the smallest integer value greater than or equal to the number specified by the parameter.

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

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

Examples

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

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

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

SELECT ceiling('abc');
ceiling('abc') =