SIGN

Syntax

SIGN( number )

Description

Returns the sign of the number number:

  • -1 if the number is negative.
    0 if the number is zero.
  • 1 if the number is positive.

Argument types:

  • numberFractional number | Integer

Return type: Integer

Example

[value]SIGN([value])
1.001
0.101
-2.00-1
50.501
0.000
-3.50-1

Data source support

ClickHouse 21.8, Microsoft SQL Server 2017 (14.0), MySQL 5.7, Oracle Database 12c (12.1), PostgreSQL 9.3, YDB.

Previous
Next