CEIL()

Description

The CEIL(X) function returns the smallest integer value not less than X.

Syntax

1. > CEIL(X)

Arguments

Arguments Description
X Required. Any numeric data type supported now.

For exact-value numeric arguments, the return value has an exact-value numeric type. For floating-point arguments, the return value has a floating-point type.

Examples

1. > drop table if exists t1;
2. > create table t1(a int ,b float);
3. > insert into t1 values(1,0.5);
4. > insert into t1 values(2,0.499);
5. > insert into t1 values(3,0.501);
6. > insert into t1 values(4,20.5);
7. > insert into t1 values(5,20.499);
8. > insert into t1 values(6,13.500);
9. > insert into t1 values(7,-0.500);
10. > insert into t1 values(8,-0.499);
11. > insert into t1 values(9,-0.501);
12. > insert into t1 values(10,-20.499);
13. > insert into t1 values(11,-20.500);
14. > insert into t1 values(12,-13.500);
15. > select a,ceil(b) from t1;
16. +------+----------+
17. | a    | ceil(b)  |
18. +------+----------+
19. |    1 |   1.0000 |
20. |    2 |   1.0000 |
21. |    3 |   1.0000 |
22. |    4 |  21.0000 |
23. |    5 |  21.0000 |
24. |    6 |  14.0000 |
25. |    7 |  -0.0000 |
26. |    8 |  -0.0000 |
27. |    9 |  -0.0000 |
28. |   10 | -20.0000 |
29. |   11 | -20.0000 |
30. |   12 | -13.0000 |
31. +------+----------+
32. > select sum(ceil(b)) from t1;
33. +--------------+
34. | sum(ceil(b)) |
35. +--------------+
36. |       6.0000 |
37. +--------------+

Constraints

Currently, MatrixOne doesn’t support select function() without from tables.