Home > Database > Mysql Tutorial > mysql SIGN(x) 判断数字x是正数负数还是零

mysql SIGN(x) 判断数字x是正数负数还是零

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 09:56:49
Original
5363 people have browsed it

mysql SIGN(x)符号函数,根据数值返回1(正数) 0(零) -1(负数).

下面用一个实例来说明SIGN()符号函数的使用方法:

<code class="language-sql">mysql> SELECT SIGN(-32); 
      -1

mysql> SELECT SIGN(0); 
      0

mysql> SELECT SIGN(234); 
      1</code>
Copy after login

即:如果x是正数,则返回1,如果x是负数,则返回-1,如果x是0,则返回0。

Related labels:
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
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template