Skip to main content

POSITIVE

Description​

Returns the value itself.

Syntax​

POSITIVE(<x>)

Parameters​

ParameterDescription
<x>The value that needs to be returned.

Return value​

Returns an integer or a floating-point number. Special cases:

  • If the parameter is NULL, return NULL.

Example​

SELECT positive(-10);
+---------------+
| positive(-10) |
+---------------+
| -10 |
+---------------+
SELECT positive(10.111);
+------------------+
| positive(10.111) |
+------------------+
| 10.111 |
+------------------+
SELECT positive(12);
+--------------+
| positive(12) |
+--------------+
| 12 |
+--------------+
SELECT positive(null);
+----------------+
| positive(NULL) |
+----------------+
| NULL |
+----------------+