![](/img/trans.png)
[英]Code for displaying the smallest power of 2 greater than or equal than the integer
[英]oracle - How do we get the smallest number value that is greater than or equal
我们如何获得大于或等于Oracle DB中参数的最小数值。 就像Java中的Math.ceil()方法一样。
For eg,
0.625 -> needs to return 1
0.2 -> needs to return 1
1.2 -> needs to return 2
1.0 -> needs to return 1
您可以在查询中使用Oracle CEIL()
函数。 从文档中
CEIL返回大于或等于n的最小整数。
此函数将可以隐式转换为数字数据类型的任何数字数据类型或任何非数字数据类型作为参数。 该函数返回与参数的数字数据类型相同的数据类型。
例如:
SELECT CEIL(column) FROM table;
在Oracle中使用ceil
函数!
select ceil(.625) from dual;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.