Syntax
CEIL(expr)
Purpose
CEIL() returns the smallest integer that is greater than or equal to expr.
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 CEIL(1.2), CEIL(-1.2), CEIL(1+1.5), CEIL(1=1),CEIL(1<1),CEIL(null);
+-----------+------------+-------------+-----------+-----------+------------+
| CEIL(1.2) | CEIL(-1.2) | CEIL(1+1.5) | CEIL(1=1) | CEIL(1<1) | CEIL(null) |
+-----------+------------+-------------+-----------+-----------+------------+
| 2 | -1 | 3 | 1 | 0 | NULL |
+-----------+------------+-------------+-----------+-----------+------------+
1 row in set
obclient> SELECT CEIL(name);
ERROR 1054 (42S22): Unknown column 'name' in 'field list'
obclient> SELECT CEIL('2');
+-----------+
| CEIL('2') |
+-----------+
| 2 |
+-----------+
1 row in set