CEIL
The CEIL function returns the smallest integer greater than or equal to Expression.
SQL syntax
CEIL(Expression)Parameters
CEIL has the parameter:
| Parameter | Description |
|---|---|
|
|
Operand or column can be any numeric data type. |
Description
-
If
Expressionis of typeNUMBER, the data type returned isNUMBERwith maximum precision and scale. Otherwise,CEILreturns the same data type as the numeric data type ofExpression. -
If the value of
ExpressionisNULL,NULLis returned. If the value ofExpressionis-INF,INF, orNaN, the value returned is-INF,INF, orNaNrespectively.
Examples
Sum the commission_pct for employees in the employees table, and then call CEIL to return the smallest integer greater than or equal to the value returned by SUM. You see the value returned by the SUM function is 7.8 and the value returned by the CEIL function is 8.
Command> SELECT SUM (commission_pct) FROM employees; < 7.8 > 1 row found. Command> SELECT CEIL (SUM (commission_pct)) FROM employees; < 8 > 1 row found.