Updated on 2026-11-06 GMT+08:00

positive

The positive function is used to return the value of a.

Syntax

positive(INT a) 

Parameters

Parameter

Mandatory

Type

Description

a

Yes

DOUBLE, BIGINT, DECIMAL, or STRING

The format of parameter a includes floating-point format, integer format, and string format.

Return Values

Returns a value of type DECIMAL, DOUBLE, or INT.

If a is NULL, NULL is returned.

Example Code

Returns 3.

SELECT positive(3); 

Returns -3.

SELECT positive(-3); 

Returns 123.

SELECT positive('123');