# sign

> 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: sign
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/sign
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/sign.adoc
page-edit-url: https://github.com/redpanda-data/cloud-docs/edit/main/modules/reference/pages/sql/sql-functions/math-functions/sign.adoc
description: The `sign()` function returns a sign of an argument.
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/sign.md -->

The `sign()` function returns a sign of an argument. The returned values are -1 if the argument is less than zero, 1 if the argument is greater than zero, 0 if the argument is equal to zero.

## [](#syntax)Syntax

The syntax for the `sign()` function is:

```sql
SIGN(x)
```

The `sign()` function requires one argument:

-   `x`: An expression that evaluates to a number.


## [](#examples)Examples

### [](#sign-of-a-number)Sign of a number

This example demonstrates how the `sign()` function can be used to obtain the sign of a number:

```sql
SELECT
    SIGN(0.1) AS "SIGN(0.1)",
    SIGN(999) AS "SIGN(999)",
    SIGN(0) AS "SIGN(0)",
    SIGN(-0) AS "SIGN(-0)";
```

The query will return the signs of the passed arguments:

```sql
 SIGN(0.1) | SIGN(999) | SIGN(0) | SIGN(-0)
-----------+-----------+---------+----------
         1 |         1 |       0 |        0
```

Note: `-0` is accepted as an argument and is equal to zero

### [](#sign-function-with-an-expression)`sign()` function with an expression

This example demonstrates how to use the `sign()` function with an expression:

```sql
SELECT SIGN(100 - 200);
```

will return the sign of the expression evaluation:

```sql
 sign
------
   -1
------
```

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

This example demonstrates how to use the `sign()` function with a table to obtain the absolute values of all numbers in a specific column:

1.  Create a table signTable containing an **_value_** column with some positive, negative and equal to zero values:

    ```sql
    CREATE TABLE signTable(value float);

    INSERT INTO signTable(value)
    VALUES
    (1000),
    (-200),
    (0),
    (0.22),
    (-12.3),
    (-0.0);
    ```

2.  Use this query to find the sign of all inserted values:

    ```sql
    SELECT value, SIGN(value) AS sign
    FROM signTable;
    ```

3.  Result:

    ```sql
     value | sign
    -------+------
      1000 |    1
      -200 |   -1
         0 |    0
      0.22 |    1
     -12.3 |   -1
        -0 |    0
    ```