Home >Database >Mysql Tutorial >mysql least()函数获取最小值

mysql least()函数获取最小值

WBOY
WBOYOriginal
2016-06-01 09:56:562290browse

LEAST(N1,N2,N3,N4,......)

LEAST()函数是GREATEST()函数的相反函数。其目的是为了从列表值返回至少值项(N1,N2,N3,等等)。下面的例子显示了LEAST()函数适当的使用和输出:

<code class="language-sql">mysql>SELECT LEAST(3,5,1,8,33,99,34,55,67,43);
+---------------------------------------------------------+
| LEAST(3,5,1,8,33,99,34,55,67,43)                        |
+---------------------------------------------------------+
| 1                                                       |
+---------------------------------------------------------+
1 row in set (0.00 sec)</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