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

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

WBOY
Release: 2016-06-01 09:57:01
Original
3645 people have browsed it

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

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

返回X 的绝对值。

实例:

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template