メインコンテンツまでスキップ
バージョン: 3.2

positive

説明

x を値として返します。

構文

POSITIVE(x);

パラメータ

x: BIGINT、DOUBLE、DECIMALV2、DECIMAL32、DECIMAL64、および DECIMAL128 データ型をサポートします。

戻り値

x の値のデータ型と同じデータ型の値を返します。

mysql> select positive(3);
+-------------+
| positive(3) |
+-------------+
| 3 |
+-------------+
1 row in set (0.01 sec)

mysql> select positive(cast(3.14 as decimalv2));
+--------------------------------------+
| positive(CAST(3.14 AS DECIMAL(9,0))) |
+--------------------------------------+
| 3.14 |
+--------------------------------------+
1 row in set (0.01 sec)