Round a number up to the nearest integer.
The CEIL() function, also known as CEILING(), returns the smallest integer that is greater than or equal to the specified numeric expression. For example, CEIL(4.1) returns 5 and CEIL(-4.9) returns -4. CEIL() is useful for rounding up quantities, computing page counts from total items, and any scenario where fractional amounts must be rounded to the next whole number. It is part of the ANSI SQL standard and is supported across major database systems including PostgreSQL, MySQL, SQL Server, and Oracle.
| Name | Description | Optional |
|---|---|---|
numeric_expression |
A numeric value or column to round up to the nearest integer. | No |
SELECT CEIL(4.3) AS rounded_up;
SELECT CEIL(total_items / 10.0) AS pages_needed FROM reports;