CEILING

2024-04-19 08:42:50  Updated

Syntax

CEILING(X)

Purpose

CEILING() returns the smallest integer that is greater than or equal to X. This function is the alias for the CEIL() function.

Comparison operations are supported. The comparison result is a Boolean value, which is converted into a numeric value. The result is 1 (TRUE) or 0 (FALSE).

If you enter NULL, NULL is returned.

If you enter a string of digits, it can be automatically converted into a numeric value.

The return value is converted into a BIGINT value.

Examples

obclient> SELECT CEILING(1.23);
+---------------+
| CEILING(1.23) |
+---------------+
|             2 |
+---------------+
1 row in set

obclient> SELECT CEILING(-1.23);
+----------------+
| CEILING(-1.23) |
+----------------+
|             -1 |
+----------------+
1 row in set

Contact Us