SIGN()

Overview

Returns the sign of the argument.

USAGE

SIGN(number)

Argument Name

Description

number

The numeric whose sign is to be determined

DETAILS

SIGN() is a mathematical function that returns the sign of the argument as -1, 0, or 1 for negative, zero, and positive numeric values respectively.

The number argument can be any numeric data type, or a literal value that can be much larger than any data type accepts.

A NULL is returned if the argument is NULL.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT SIGN(-10);
+-----------+
| SIGN(-10) |
+-----------+
|        -1 |
+-----------+
SELECT SIGN(123);
+-----------+
| SIGN(123) |
+-----------+
|         1 |
+-----------+
SELECT SIGN(922337203685477580792233720368547750000000000000000000000) AS result;
+--------+
| result |
+--------+
|      1 |
+--------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES