# ceil

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [cloud-data-platform-full.txt](https://docs.redpanda.com/cloud-data-platform-full.txt)

---
title: ceil
latest-operator-version: v26.1.4
latest-console-tag: v3.7.3
latest-connect-version: 4.93.0
latest-redpanda-tag: v26.1.9
docname: sql/sql-functions/math-functions/ceil
page-component-name: cloud-data-platform
page-version: master
page-component-version: master
page-component-title: Cloud
page-relative-src-path: sql/sql-functions/math-functions/ceil.adoc
page-edit-url: https://github.com/redpanda-data/cloud-docs/edit/main/modules/reference/pages/sql/sql-functions/math-functions/ceil.adoc
description: The `ceil()` function returns the nearest positive or negative integer value greater than or equal to the provided decimal input number.
page-topic-type: reference
page-git-created-date: "2026-05-26"
page-git-modified-date: "2026-05-26"
---

<!-- Source: https://docs.redpanda.com/cloud-data-platform/reference/sql/sql-functions/math-functions/ceil.md -->

The `ceil()` function returns the nearest positive or negative integer value greater than or equal to the provided decimal input number.

## [](#syntax)Syntax

The syntax of the `ceil()` function is:

```sql
CEIL(x)
```

The `ceil()` function requires one argument:

-   `x`: A positive or a negative decimal number (or an expression that evaluates to a decimal number).


## [](#examples)Examples

### [](#round-up-a-positive-decimal-value)Round up a positive decimal value

This example demonstrates how the `ceil()` function rounds up a positive decimal value:

```sql
SELECT CEIL (300.55);
```

This returns 301, as it is the nearest integer value greater than 300.55.

```sql
+------+
| f    |
+------+
| 301  |
+------+
```

### [](#round-up-a-negative-decimal-value)Round up a negative decimal value

This example demonstrates how the `ceil()` function rounds up a negative decimal value:

```sql
SELECT CEIL(-89.9) AS "Ceil";
```

The output of this statement is -89, as -89 is the nearest integer value greater than or equal to -89.9.

```sql
+-------+
| Ceil  |
+-------+
| -89   |
+-------+
```

### [](#use-the-ceil-function-with-a-table)Use the `ceil()` function with a table

This example demonstrates how to use the `ceil()` function with a table to round up values in a specific column:

1.  First, create a table called **_CeilRecords_**:

    ```sql
    CREATE TABLE CeilRecords (numbers float);

    INSERT INTO CeilRecords(numbers)
    VALUES
        (-28.85),
        (-9.4),
        (0.87),
        (78.16),
        (42.16);
    ```

    This statement creates a table called **“CeilRecords”** with a column called **“numbers”** and insert 5 decimal values into it.

2.  Retrieve and round up the value for all records in the **numbers** column:

    ```sql
    SELECT *, CEIL(numbers) AS CeilValue FROM CeilRecords;
    ```

    The final result will contain:

    -   A **numbers** column with initial decimal values.

    -   A **CeilValue** column with rounded-up integer values.

        ```sql
        +---------+------------+
        | numbers  | CeilValue  |
        +---------+------------+
        | -28.85  | -28        |
        | -9.4    | -9         |
        | 0.87    | 1          |
        | 78.16   | 79         |
        | 42.16   | 43         |
        +---------+------------+
        ```