Home >Database >Mysql Tutorial >mysql 计算/获取绝对值函数ABS() 使用方法和实例

mysql 计算/获取绝对值函数ABS() 使用方法和实例

WBOY
WBOYOriginal
2016-06-01 09:57:013645browse

在mysql中ABS函数是用来取绝对值的,这个函数没什么更多用法就是一个简单绝对值了,下面给大家介绍几个例子吧。

<code class="language-sql">ABS(X)</code>

返回X 的绝对值。

实例:

<code class="language-sql">mysql> SELECT ABS(2);
        -> 2
mysql> SELECT ABS(-32);
        -> 32</code>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn