SQL Tutorial

SQL CEIL (or CEILING) and FLOOR Functions

Both SQL CEIL(or CEILING) and FLOOR functions are round the numbers. SQL CEIL roundup to the nearest integer value while FLOOR round down to the next least integer value. Here is the syntax:

CEIL(<numerical expression>)
CEILING(<numerical expression>)
FLOOR(<numerical expression>)

Here is a query example:

SELECT CEIL(10.19) AS ceil_value,
FLOOR(10.19) AS floor_value

And the output is

ceil_value  floor_value
----------  -----------
        11           10
Read On