![](/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.