SQL ABS()函數

ABS(X)

ABS()函數返回X的絕對值,請考慮以下的例子:

SQL> SELECT ABS(2);
+---------------------------------------------------------+
| ABS(2) |
+---------------------------------------------------------+
| 2 |
+---------------------------------------------------------+
1 row in set (0.00 sec)

SQL> SELECT ABS(-2);
+---------------------------------------------------------+
| ABS(2) |
+---------------------------------------------------------+
| 2 |
+---------------------------------------------------------+
1 row in set (0.00 sec)

0 條評論,你可以發表評論,我們會進行改進
Comment author placeholder