The CEIL function in Oracle SQL / PLSQL is used to get a smallest integer number which is greater than or equal to the number passed to the function.
Syntax for the CEIL function in Oracle SQL / PLSQL is:
SELECT CEIL(N)
FROM table_name;
- N is the number passed
Example 1:
1 | SELECT CEIL(1.23456) |
2 | FROM DUAL; |
Will return “2”
Example 2:
1 | SELECT CEIL(2.2) |
2 | FROM DUAL; |
Will return “3”
Example 3:
1 | SELECT CEIL(2.051) |
2 | FROM DUAL; |
Will return “3”
Example 4:
1 | SELECT CEIL(-2.051) |
2 | FROM DUAL; |
Will return “-2”