Skip to content

SIGN

  • x: This parameter corresponds to the numeric value whose sign you want to calculate. If X is positive, the SIGN function will return 1. If X is negative, the SIGN function will return -1. If X is zero, the SIGN function will return 0.
SELECT SIGN(-15);
SELECT SIGN(0);
SELECT SIGN(45);
-1
0
1

In the given example, the SIGN() function returns -1 when the argument is negative (-15), 0 when the argument is zero (0), and 1 when the argument is positive (45). This function is useful for categorizing data into positive, negative, and zero groups.