Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Blog
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
Yandex project
© 2023 Intertech Services AG
Yandex DataLens
  • Getting started
  • Practical guidelines
  • Concepts
  • Step-by-step instructions
  • Access management
  • Pricing policy
  • Visualization reference
  • Function reference
    • All Functions
    • Aggregate functions
    • Array functions
    • Date/Time functions
    • Logical functions
    • Mathematical functions
      • Overview
      • ABS
      • ACOS
      • ASIN
      • ATAN
      • ATAN2
      • CEILING
      • COMPARE
      • COS
      • COT
      • DEGREES
      • DIV
      • DIV_SAFE
      • EXP
      • FDIV_SAFE
      • FLOOR
      • GREATEST
      • LEAST
      • LN
      • LOG
      • LOG10
      • PI
      • POWER
      • RADIANS
      • ROUND
      • SIGN
      • SIN
      • SQRT
      • SQUARE
      • TAN
    • Operators
    • String functions
    • Text markup functions
    • Time series functions
    • Type conversion functions
    • Window functions
    • Function Availability
  • Function tutorials
  • Educational projects
  • Troubleshooting
    • Questions and answers
    • DataLens errors
  1. Function reference
  2. Mathematical functions
  3. SIGN

SIGN

Written by
Yandex Cloud
,
improved by
amatol

    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:

    • number — Fractional number | Integer

    Return type: Integer

    Example

    [value] SIGN([value])
    1.00 1
    0.10 1
    -2.00 -1
    50.50 1
    0.00 0
    -3.50 -1

    Data source support

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

    Was the article helpful?

    Language / Region
    Yandex project
    © 2023 Intertech Services AG