Syntax
CEIL(expr)
Purpose
Returns the smallest integer greater than or equal to expr.
It supports comparison operations and returns a BOOL value, which is converted to a numeric type. The result is 1 (TRUE) or 0 (FALSE).
If the input is NULL, the return value is NULL.
If the input is a string of pure numbers, it is automatically converted to a numeric type.
The return value is converted to a BIGINT.
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
