ceil function
The ceil function returns the smallest integer that is greater than or equal to the specified expression.
Syntax:
number ceil(n)
Semantics:
-
n: The argument n is an expression that resolves to a number.
-
return type:
-
Returns the same type as the argument n.
-
Returns a NULL value in the following cases:
-
n resolves to a NULL value
-
n does not resolve to a number
-
-
Returns NaN if n resolves to NaN.
-
Returns a positive/negative infinity if n resolves to the respective infinity.
-
Returns a positive/negative zero if n resolves to the respective zero value.
-
Example 1 - ceil function
SELECT ceil(n) FROM Userstocks
| Value of n | Output |
|---|---|
| 1.34 | 2.0 |
| -1.34 | -1.0 |
| pi() | 4.0 |