Skip to content

CEIL

Calculates values for expr that are rounded up to the next equal or larger integer or to the next equal or larger value.

Syntax

sql
CEIL(expr)

Arguments

expr: The DECIMAL value to be processed.

Notes

  • When negative numbers are rounded up, the value is closer to 0. Example: CEIL(-2.72) = -2 and CEIL(2.72) = 3.
  • If the number exceeds the datatype range due to rounding, an error is returned.

Example 1

sql
SELECT ceil(734.9191), ceil(-734.9191);
+----------------+-----------------+
| CEIL(734.9191) | CEIL(-734.9191) |
+----------------+-----------------+
| 735            | -734            |
+----------------+-----------------+