November 2008
Intermediate to advanced
591 pages
17h 28m
English
CEIL
The CEIL function returns the smallest integer greater than an input value that you specify.
ANSI SQL supports the following two forms of the function:
CEIL(expression) CEILING(expression)
MySQL and PostgreSQL support both CEIL and CEILING.
Oracle supports only CEIL.
SQL Server supports only CEILING.
When you pass a positive, non-integer number, the effect of CEIL is to round up to the next highest integer:
SELECT CEIL(100.1) FROM dual;
CEIL(100.1)
------------
101Remember, though, that with negative numbers, rounding “up” results in a lower absolute value:
SELECT CEIL(−100.1) FROM dual;
CEIL(−100.1)
-------------
−100Use FLOOR to get behavior opposite to that of CEIL.
Read now
Unlock full access