What is the use of CEILING function in ORACLE?

 Posted by Abhisek on 2/25/2010 | Category: Others Interview questions | Views: 7869
Answer:

This post is related with ORACLE
----------------------------------------------

The CEILING function does the opposite of FLOOR function. It returns the smallest integer greater than the value you specify.

Syntax:-
CEILING(expression)

Example:-
SELECT CEILING(400.45) 

It will output 401.

NOTE:- It rounds up the non-integer number to the next highest value. If you enter negative value, it will return the lower absolute value.

Example:-
SELECT CEILING(-400.45) 

It will output -400.

======================================================================
The author couldn't update this after PandianS response so this post has been updated by Moderator based on PandianS response.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: PandianS on: 12/11/2010 | Points: 10
Hi

Kindly move this to Oracle(If any).
or
Atleast, Please specify that This post belongs to ORACLE. Because, Some body will try to execute this script on SQL Server, They will get an Error.

Pls specify that, "What is the use of CEILING function in ORACLE"

or

Kindly remove the "From Dual" from the script.

simply use SELECT CEILING(-400.45), But the answer would be -400, kindly change the answer also.

Cheers

Login to post response