Skip to main content

SIGN

Returns the sign of the argument as -1, 0, or 1, depending on whether x is negative, zero, or positive or NULL if the argument was NULL.

Syntax

SIGN( <x> )

Examples

SELECT SIGN(0);

┌─────────┐
│ sign(0)
├─────────┤
0
└─────────┘
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today