# Oracle CEIL Function

Oracle CEIL function | The ceil() function in the Oracle database returns the smallest integer greater than or equal to the passed number N.

The return value of the ceil() function is always an integer number but the passed parameter can be any numeric datatype or any non-numeric data type that can implicitly be converted to a numeric datatype.

The word CEIL is short for CEILING. The ceil() function essentially rounds up to the nearest whole number and is the opposite of the FLOOR function (which rounds down to the nearest whole number).

Syntax:-
`CEIL(N)`

Return value:- Integer
Parameter (N):- Any number

ceil(1.1) = 2
ceil(4.3) = 5
ceil(9.5) = 10
ceil(5.9) = 6
ceil(6.0) = 6

Examples:-

``````SQL> SELECT CEIL(4.0) FROM DUAL;

CEIL(4.0)
----------
4``````
``````SQL> SELECT CEIL(4.1) FROM DUAL;

CEIL(4.1)
----------
5``````
``````SQL> SELECT CEIL(4.5) FROM DUAL;

CEIL(4.5)
----------
5``````
``````SQL> SELECT CEIL(4.9) FROM DUAL;

CEIL(4.9)
----------
5``````
``````SQL> SELECT CEIL(-4.9) FROM DUAL;

CEIL(-4.9)
----------
-4``````
``````SQL> SELECT CEIL(-4.0) FROM DUAL;

CEIL(-4.0)
----------
-4``````

In the CEIL() function of Oracle database,

• If we pass an integer value then it will return the same integer number.
• If we pass zero (0), then the result of this function is zero (0).
• For NULL value, the ceil() return NULL itself.
• If the passed digit is less than zero but greater than -1.0 then the ceil() function will return zero (0) as a result.

Examples:-

``````SQL> SELECT CEIL(28) FROM dual;

CEIL(28)
----------
28``````

For the passed integer number, it returns the integer number as it is.

``````SQL> SELECT CEIL(0) FROM dual;

CEIL(0)
----------
0``````

For zero (0), it returns zero(0).

``````SQL> SELECT CEIL(-1.0) FROM dual;

CEIL(-1.0)
----------
-1``````

If number belongs between 0 to -0.9 then also ceil() function retruns zero (0).

``````SQL> SELECT CEIL(-0.9) FROM dual;

CEIL(-0.9)
----------
0``````
``````SQL> SELECT CEIL(-0.1) FROM dual;

CEIL(-0.1)
----------
0``````
``````SQL> SELECT CEIL(NULL) FROM dual;

CEIL(NULL)
----------``````

If we pass the NULL value then it will return the NULL value itself.

If you enjoyed this post, share it with your friends. Do you want to share more information about the topic discussed above or do you find anything incorrect? Let us know in the comments. Thank you!

Also, Learn,