Categories: Math
CEILING
Returns the nearest equal or larger value of the input expression, and can also be called using CEIL(). FLOAT and DOUBLE inputs keep their numeric type, while DECIMAL inputs return a DECIMAL with scale 0 and a precision that may increase when rounding produces a larger whole-number value. Returns NULL if the input is NULL.
Syntax
CEILING(numeric_expression NUMERIC) → NUMERIC
- numeric_expression: The number (DOUBLE, FLOAT, INTEGER, DECIMAL) for which you want to compute the ceiling.
Examples
CEILING exampleSELECT CEILING(3.1459)
-- 4
SELECT CEIL(37.775420706711)
-- 38
SELECT CEIL(-37.775420706711)
-- -37
SELECT CEIL(0)
-- 0
SELECT CEILING(CAST(3.14 AS FLOAT))
-- 4.0